Merge "Add ViewConfiguration.shouldShowMenuShortcutsWhenKeyboardPresent"

This commit is contained in:
Vladislav Kaznacheev
2018-03-02 17:34:04 +00:00
committed by Android (Google) Code Review
3 changed files with 18 additions and 2 deletions

View File

@@ -303,6 +303,7 @@ public class ViewConfiguration {
private final long mGlobalActionsKeyTimeout;
private final float mVerticalScrollFactor;
private final float mHorizontalScrollFactor;
private final boolean mShowMenuShortcutsWhenKeyboardPresent;
private boolean sHasPermanentMenuKey;
private boolean sHasPermanentMenuKeySet;
@@ -335,6 +336,7 @@ public class ViewConfiguration {
mGlobalActionsKeyTimeout = GLOBAL_ACTIONS_KEY_TIMEOUT;
mHorizontalScrollFactor = HORIZONTAL_SCROLL_FACTOR;
mVerticalScrollFactor = VERTICAL_SCROLL_FACTOR;
mShowMenuShortcutsWhenKeyboardPresent = false;
}
/**
@@ -428,6 +430,10 @@ public class ViewConfiguration {
com.android.internal.R.dimen.config_horizontalScrollFactor);
mVerticalScrollFactor = res.getDimensionPixelSize(
com.android.internal.R.dimen.config_verticalScrollFactor);
mShowMenuShortcutsWhenKeyboardPresent = res.getBoolean(
com.android.internal.R.bool.config_showMenuShortcutsWhenKeyboardPresent);
}
/**
@@ -909,6 +915,15 @@ public class ViewConfiguration {
return sHasPermanentMenuKey;
}
/**
* Check if shortcuts should be displayed in menus.
*
* @return {@code True} if shortcuts should be displayed in menus.
*/
public boolean shouldShowMenuShortcutsWhenKeyboardPresent() {
return mShowMenuShortcutsWhenKeyboardPresent;
}
/**
* @hide
* @return Whether or not marquee should use fading edges.