當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。