Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f1aab4de authored by Vladislav Kaznacheev's avatar Vladislav Kaznacheev Committed by Android (Google) Code Review
Browse files

Merge "Add ViewConfiguration.shouldShowMenuShortcutsWhenKeyboardPresent"

parents 8c334d0b a725df99
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -48822,6 +48822,7 @@ package android.view {
    method public static deprecated int getWindowTouchSlop();
    method public static long getZoomControlsTimeout();
    method public boolean hasPermanentMenuKey();
    method public boolean shouldShowMenuShortcutsWhenKeyboardPresent();
  }
  public class ViewDebug {
+15 −0
Original line number Diff line number Diff line
@@ -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.
+2 −2
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ import android.view.Menu;
import android.view.MenuItem;
import android.view.SubMenu;
import android.view.View;
import android.view.ViewConfiguration;

import java.lang.ref.WeakReference;
import java.util.ArrayList;
@@ -753,8 +754,7 @@ public class MenuBuilder implements Menu {
    private void setShortcutsVisibleInner(boolean shortcutsVisible) {
        mShortcutsVisible = shortcutsVisible
                && mResources.getConfiguration().keyboard != Configuration.KEYBOARD_NOKEYS
                && mResources.getBoolean(
                        com.android.internal.R.bool.config_showMenuShortcutsWhenKeyboardPresent);
                && ViewConfiguration.get(mContext).shouldShowMenuShortcutsWhenKeyboardPresent();
    }

    /**