From 544593188f0c6ced55714e7510d0d087ba4d0406 Mon Sep 17 00:00:00 2001 From: Beth Thibodeau Date: Fri, 7 May 2021 12:43:59 -0400 Subject: Improve power menu animation The animation coordinates were messed up because the dialog did not fill the screen vertically, so increased the height to match_parent Bug: 186002852 Test: visual, in/out animation both move horizontally from right edge Change-Id: Icbebeaa76ac1104b3100cdfba5c35ae8e6f89f47 --- packages/SystemUI/res/layout/global_actions_grid_lite.xml | 2 +- .../android/systemui/globalactions/GlobalActionsDialogLite.java | 8 +++++--- .../android/systemui/globalactions/GlobalActionsLayoutLite.java | 1 + 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/SystemUI/res/layout/global_actions_grid_lite.xml b/packages/SystemUI/res/layout/global_actions_grid_lite.xml index 0df980054c0c..2430eec77678 100644 --- a/packages/SystemUI/res/layout/global_actions_grid_lite.xml +++ b/packages/SystemUI/res/layout/global_actions_grid_lite.xml @@ -18,7 +18,7 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/global_actions_container" android:layout_width="match_parent" - android:layout_height="wrap_content" + android:layout_height="match_parent" android:orientation="vertical" android:gravity="center" android:layout_gravity="center"> diff --git a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java index 19edeb80c10c..2eb37624f598 100644 --- a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java +++ b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java @@ -583,7 +583,6 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene mStatusBarService, mNotificationShadeWindowController, mSysUiState, this::onRotate, mKeyguardShowing, mPowerAdapter); - dialog.setCanceledOnTouchOutside(true); dialog.setOnDismissListener(this); dialog.setOnShowListener(this); @@ -2080,7 +2079,7 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene window.getDecorView(); window.getAttributes().systemUiVisibility |= View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION; - window.setLayout(MATCH_PARENT, WRAP_CONTENT); + window.setLayout(MATCH_PARENT, MATCH_PARENT); window.addFlags( WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR @@ -2141,6 +2140,10 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene mGlobalActionsLayout.setRotationListener(this::onRotate); mGlobalActionsLayout.setAdapter(mAdapter); mContainer = findViewById(com.android.systemui.R.id.global_actions_container); + mContainer.setOnClickListener(v -> { + // TODO: add logging (b/182830510) + cancel(); + }); View overflowButton = findViewById( com.android.systemui.R.id.global_actions_overflow_button); @@ -2178,7 +2181,6 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene @Override protected void onStart() { - super.setCanceledOnTouchOutside(true); super.onStart(); mGlobalActionsLayout.updateList(); diff --git a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsLayoutLite.java b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsLayoutLite.java index eb4cd6b449a2..f1e5b0862ae0 100644 --- a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsLayoutLite.java +++ b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsLayoutLite.java @@ -42,6 +42,7 @@ public class GlobalActionsLayoutLite extends GlobalActionsLayout { com.android.systemui.R.integer.power_menu_lite_max_columns); mMaxRows = getResources().getInteger( com.android.systemui.R.integer.power_menu_lite_max_rows); + setOnClickListener(v -> { }); // Prevent parent onClickListener from triggering } @VisibleForTesting -- cgit v1.2.3-59-g8ed1b