本文整理汇总了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;
}
示例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();
}
}
}
示例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;
}
示例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;
}
示例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;
}