Loading core/java/com/android/internal/view/menu/MenuPopupHelper.java +13 −2 Original line number Diff line number Diff line Loading @@ -23,10 +23,13 @@ import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.StyleRes; import android.content.Context; import android.graphics.Point; import android.graphics.Rect; import android.util.DisplayMetrics; import android.view.Display; import android.view.Gravity; import android.view.View; import android.view.WindowManager; import android.widget.PopupWindow.OnDismissListener; /** Loading Loading @@ -209,8 +212,16 @@ public class MenuPopupHelper implements MenuHelper { */ @NonNull private MenuPopup createPopup() { final boolean enableCascadingSubmenus = mContext.getResources().getBoolean( com.android.internal.R.bool.config_enableCascadingSubmenus); final WindowManager windowManager = (WindowManager) mContext.getSystemService( Context.WINDOW_SERVICE); final Display display = windowManager.getDefaultDisplay(); final Point displaySize = new Point(); display.getRealSize(displaySize); final int smallestWidth = Math.min(displaySize.x, displaySize.y); final int minSmallestWidthCascading = mContext.getResources().getDimensionPixelSize( com.android.internal.R.dimen.cascading_menus_min_smallest_width); final boolean enableCascadingSubmenus = smallestWidth >= minSmallestWidthCascading; final MenuPopup popup; if (enableCascadingSubmenus) { Loading core/res/res/values-sw720dp/config.xml +0 −3 Original line number Diff line number Diff line Loading @@ -19,7 +19,4 @@ used for picking activities to handle an intent. --> <integer name="config_maxResolverActivityColumns">4</integer> <!-- Enable cascading submenus. --> <bool name="config_enableCascadingSubmenus">true</bool> </resources> core/res/res/values/config.xml +0 −4 Original line number Diff line number Diff line Loading @@ -2380,10 +2380,6 @@ must match the value of config_cameraLaunchGestureSensorType in OEM's HAL --> <string translatable="false" name="config_cameraLaunchGestureSensorStringType"></string> <!-- Whether to open UI submenus side by side with the top menu (as opposed to replacing the top menu). --> <bool name="config_enableCascadingSubmenus">false</bool> <!-- Allow the gesture to double tap the power button twice to start the camera while the device is non-interactive. --> <bool name="config_cameraDoubleTapPowerGestureEnabled">true</bool> Loading core/res/res/values/dimens.xml +3 −0 Original line number Diff line number Diff line Loading @@ -468,4 +468,7 @@ <!-- The default minimal size of a resizable task, in both dimensions. --> <dimen name="default_minimal_size_resizable_task">220dp</dimen> <!-- Minimum "smallest width" of the display for cascading menus to be enabled. --> <dimen name="cascading_menus_min_smallest_width">720dp</dimen> </resources> core/res/res/values/symbols.xml +2 −1 Original line number Diff line number Diff line Loading @@ -2256,7 +2256,8 @@ <java-symbol type="string" name="prohibit_manual_network_selection_in_gobal_mode" /> <java-symbol type="id" name="profile_button" /> <java-symbol type="bool" name="config_enableCascadingSubmenus" /> <!-- Cascading submenus --> <java-symbol type="dimen" name="cascading_menus_min_smallest_width" /> <!-- From SignalStrength --> <java-symbol type="integer" name="config_LTE_RSRP_threshold_type" /> Loading Loading
core/java/com/android/internal/view/menu/MenuPopupHelper.java +13 −2 Original line number Diff line number Diff line Loading @@ -23,10 +23,13 @@ import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.StyleRes; import android.content.Context; import android.graphics.Point; import android.graphics.Rect; import android.util.DisplayMetrics; import android.view.Display; import android.view.Gravity; import android.view.View; import android.view.WindowManager; import android.widget.PopupWindow.OnDismissListener; /** Loading Loading @@ -209,8 +212,16 @@ public class MenuPopupHelper implements MenuHelper { */ @NonNull private MenuPopup createPopup() { final boolean enableCascadingSubmenus = mContext.getResources().getBoolean( com.android.internal.R.bool.config_enableCascadingSubmenus); final WindowManager windowManager = (WindowManager) mContext.getSystemService( Context.WINDOW_SERVICE); final Display display = windowManager.getDefaultDisplay(); final Point displaySize = new Point(); display.getRealSize(displaySize); final int smallestWidth = Math.min(displaySize.x, displaySize.y); final int minSmallestWidthCascading = mContext.getResources().getDimensionPixelSize( com.android.internal.R.dimen.cascading_menus_min_smallest_width); final boolean enableCascadingSubmenus = smallestWidth >= minSmallestWidthCascading; final MenuPopup popup; if (enableCascadingSubmenus) { Loading
core/res/res/values-sw720dp/config.xml +0 −3 Original line number Diff line number Diff line Loading @@ -19,7 +19,4 @@ used for picking activities to handle an intent. --> <integer name="config_maxResolverActivityColumns">4</integer> <!-- Enable cascading submenus. --> <bool name="config_enableCascadingSubmenus">true</bool> </resources>
core/res/res/values/config.xml +0 −4 Original line number Diff line number Diff line Loading @@ -2380,10 +2380,6 @@ must match the value of config_cameraLaunchGestureSensorType in OEM's HAL --> <string translatable="false" name="config_cameraLaunchGestureSensorStringType"></string> <!-- Whether to open UI submenus side by side with the top menu (as opposed to replacing the top menu). --> <bool name="config_enableCascadingSubmenus">false</bool> <!-- Allow the gesture to double tap the power button twice to start the camera while the device is non-interactive. --> <bool name="config_cameraDoubleTapPowerGestureEnabled">true</bool> Loading
core/res/res/values/dimens.xml +3 −0 Original line number Diff line number Diff line Loading @@ -468,4 +468,7 @@ <!-- The default minimal size of a resizable task, in both dimensions. --> <dimen name="default_minimal_size_resizable_task">220dp</dimen> <!-- Minimum "smallest width" of the display for cascading menus to be enabled. --> <dimen name="cascading_menus_min_smallest_width">720dp</dimen> </resources>
core/res/res/values/symbols.xml +2 −1 Original line number Diff line number Diff line Loading @@ -2256,7 +2256,8 @@ <java-symbol type="string" name="prohibit_manual_network_selection_in_gobal_mode" /> <java-symbol type="id" name="profile_button" /> <java-symbol type="bool" name="config_enableCascadingSubmenus" /> <!-- Cascading submenus --> <java-symbol type="dimen" name="cascading_menus_min_smallest_width" /> <!-- From SignalStrength --> <java-symbol type="integer" name="config_LTE_RSRP_threshold_type" /> Loading