当前位置: 首页>>代码示例>>Java>>正文


Java ViewConfigurationCompat.hasPermanentMenuKey方法代码示例

本文整理汇总了Java中android.support.v4.view.ViewConfigurationCompat.hasPermanentMenuKey方法的典型用法代码示例。如果您正苦于以下问题:Java ViewConfigurationCompat.hasPermanentMenuKey方法的具体用法?Java ViewConfigurationCompat.hasPermanentMenuKey怎么用?Java ViewConfigurationCompat.hasPermanentMenuKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.support.v4.view.ViewConfigurationCompat的用法示例。


在下文中一共展示了ViewConfigurationCompat.hasPermanentMenuKey方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: virtualKeyHeight

import android.support.v4.view.ViewConfigurationCompat; //导入方法依赖的package包/类
protected int virtualKeyHeight() {
    boolean hasPermanentMenuKey = ViewConfigurationCompat.hasPermanentMenuKey(ViewConfiguration.get(getApplication()));

    DisplayMetrics metrics = new DisplayMetrics();
    Display display = getWindowManager().getDefaultDisplay();

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
        display.getRealMetrics(metrics);
    } else {
        display.getMetrics(metrics);
    }

    int fullHeight = metrics.heightPixels;

    display.getMetrics(metrics);

    return fullHeight - metrics.heightPixels;
}
 
开发者ID:AgoraIO,项目名称:OpenVoiceCall-Android,代码行数:19,代码来源:BaseActivity.java

示例2: reopenMenu

import android.support.v4.view.ViewConfigurationCompat; //导入方法依赖的package包/类
private void reopenMenu(MenuBuilder menu, boolean toggleMenuMode) {
    if (this.mDecorContentParent == null || !this.mDecorContentParent.canShowOverflowMenu() || (ViewConfigurationCompat.hasPermanentMenuKey(ViewConfiguration.get(this.mContext)) && !this.mDecorContentParent.isOverflowMenuShowPending())) {
        PanelFeatureState st = getPanelState(0, true);
        st.refreshDecorView = true;
        closePanel(st, false);
        openPanel(st, null);
        return;
    }
    Window.Callback cb = getWindowCallback();
    if (this.mDecorContentParent.isOverflowMenuShowing() && toggleMenuMode) {
        this.mDecorContentParent.hideOverflowMenu();
        if (!isDestroyed()) {
            cb.onPanelClosed(108, getPanelState(0, true).menu);
        }
    } else if (cb != null && !isDestroyed()) {
        if (this.mInvalidatePanelMenuPosted && (this.mInvalidatePanelMenuFeatures & 1) != 0) {
            this.mWindow.getDecorView().removeCallbacks(this.mInvalidatePanelMenuRunnable);
            this.mInvalidatePanelMenuRunnable.run();
        }
        st = getPanelState(0, true);
        if (st.menu != null && !st.refreshMenuContent && cb.onPreparePanel(0, st.createdPanelView, st.menu)) {
            cb.onMenuOpened(108, st.menu);
            this.mDecorContentParent.showOverflowMenu();
        }
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:27,代码来源:AppCompatDelegateImplV7.java

示例3: virtualKeyHeight

import android.support.v4.view.ViewConfigurationCompat; //导入方法依赖的package包/类
/**
 * 虚拟按键高度调整
 */
protected int virtualKeyHeight() {
    boolean hasPermanentMenuKey = ViewConfigurationCompat.hasPermanentMenuKey(ViewConfiguration.get(getApplication()));
    DisplayMetrics metrics = new DisplayMetrics();
    Display display = getWindowManager().getDefaultDisplay();
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
        display.getRealMetrics(metrics);
    } else {
        display.getMetrics(metrics);
    }
    int fullHeight = metrics.heightPixels;
    display.getMetrics(metrics);
    return fullHeight - metrics.heightPixels;
}
 
开发者ID:wzc25151,项目名称:lrs_android,代码行数:17,代码来源:AgoraActivity.java

示例4: onKeyUpPanel

import android.support.v4.view.ViewConfigurationCompat; //导入方法依赖的package包/类
private boolean onKeyUpPanel(int featureId, KeyEvent event) {
    if (this.mActionMode != null) {
        return false;
    }
    boolean handled = false;
    PanelFeatureState st = getPanelState(featureId, true);
    if (featureId != 0 || this.mDecorContentParent == null || !this.mDecorContentParent.canShowOverflowMenu() || ViewConfigurationCompat.hasPermanentMenuKey(ViewConfiguration.get(this.mContext))) {
        if (st.isOpen || st.isHandled) {
            handled = st.isOpen;
            closePanel(st, true);
        } else if (st.isPrepared) {
            boolean show = true;
            if (st.refreshMenuContent) {
                st.isPrepared = false;
                show = preparePanel(st, event);
            }
            if (show) {
                openPanel(st, event);
                handled = true;
            }
        }
    } else if (this.mDecorContentParent.isOverflowMenuShowing()) {
        handled = this.mDecorContentParent.hideOverflowMenu();
    } else if (!isDestroyed() && preparePanel(st, event)) {
        handled = this.mDecorContentParent.showOverflowMenu();
    }
    if (!handled) {
        return handled;
    }
    AudioManager audioManager = (AudioManager) this.mContext.getSystemService("audio");
    if (audioManager != null) {
        audioManager.playSoundEffect(0);
        return handled;
    }
    Log.w("AppCompatDelegate", "Couldn't get audio manager");
    return handled;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:38,代码来源:AppCompatDelegateImplV7.java

示例5: showsOverflowMenuButton

import android.support.v4.view.ViewConfigurationCompat; //导入方法依赖的package包/类
public boolean showsOverflowMenuButton() {
    if (VERSION.SDK_INT < 19 && ViewConfigurationCompat.hasPermanentMenuKey(ViewConfiguration.get(this.mContext))) {
        return false;
    }
    return true;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:7,代码来源:ActionBarPolicy.java


注:本文中的android.support.v4.view.ViewConfigurationCompat.hasPermanentMenuKey方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。