Merge "Set max items to 4 on lock screen, re-disable overflow." into rvc-dev am: d41bdc07ca am: beae6de446

Change-Id: I1bbe777ec1a8e14b14d6e0bdf90b81c51c9a9574
This commit is contained in:
Aran Ink
2020-04-28 17:02:48 +00:00
committed by Automerger Merge Worker

View File

@@ -485,7 +485,15 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener,
@VisibleForTesting @VisibleForTesting
protected int getMaxShownPowerItems() { protected int getMaxShownPowerItems() {
if (shouldUseControlsLayout()) { if (shouldUseControlsLayout()) {
return mResources.getInteger(com.android.systemui.R.integer.power_menu_max_columns); int maxColumns =
mResources.getInteger(com.android.systemui.R.integer.power_menu_max_columns);
// TODO: Overflow temporarily disabled on keyguard to prevent touch issues.
// Show an extra item on the keyguard because the overflow button currently disabled.
if (mKeyguardShowing) {
return maxColumns + 1;
} else {
return maxColumns;
}
} else { } else {
return Integer.MAX_VALUE; return Integer.MAX_VALUE;
} }
@@ -2059,7 +2067,8 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener,
View overflowButton = findViewById( View overflowButton = findViewById(
com.android.systemui.R.id.global_actions_overflow_button); com.android.systemui.R.id.global_actions_overflow_button);
if (overflowButton != null) { if (overflowButton != null) {
if (mOverflowAdapter.getCount() > 0) { // TODO: Overflow button hidden on keyguard to temporarily prevent touch issues.
if (mOverflowAdapter.getCount() > 0 && !mKeyguardShowing) {
overflowButton.setOnClickListener((view) -> showPowerOverflowMenu()); overflowButton.setOnClickListener((view) -> showPowerOverflowMenu());
LinearLayout.LayoutParams params = LinearLayout.LayoutParams params =
(LinearLayout.LayoutParams) mGlobalActionsLayout.getLayoutParams(); (LinearLayout.LayoutParams) mGlobalActionsLayout.getLayoutParams();