Merge "Improve power menu animation" into sc-dev am: 47f282905e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14469457 Change-Id: I7a1f1336d0e7c5b0061f0534f6db3793c3e4c51a
This commit is contained in:
@@ -18,7 +18,7 @@
|
|||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:id="@+id/global_actions_container"
|
android:id="@+id/global_actions_container"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:layout_gravity="center">
|
android:layout_gravity="center">
|
||||||
|
|||||||
@@ -583,7 +583,6 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene
|
|||||||
mStatusBarService, mNotificationShadeWindowController,
|
mStatusBarService, mNotificationShadeWindowController,
|
||||||
mSysUiState, this::onRotate, mKeyguardShowing, mPowerAdapter);
|
mSysUiState, this::onRotate, mKeyguardShowing, mPowerAdapter);
|
||||||
|
|
||||||
dialog.setCanceledOnTouchOutside(true);
|
|
||||||
dialog.setOnDismissListener(this);
|
dialog.setOnDismissListener(this);
|
||||||
dialog.setOnShowListener(this);
|
dialog.setOnShowListener(this);
|
||||||
|
|
||||||
@@ -2080,7 +2079,7 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene
|
|||||||
window.getDecorView();
|
window.getDecorView();
|
||||||
window.getAttributes().systemUiVisibility |= View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
window.getAttributes().systemUiVisibility |= View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
||||||
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION;
|
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION;
|
||||||
window.setLayout(MATCH_PARENT, WRAP_CONTENT);
|
window.setLayout(MATCH_PARENT, MATCH_PARENT);
|
||||||
window.addFlags(
|
window.addFlags(
|
||||||
WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN
|
WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN
|
||||||
| WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR
|
| WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR
|
||||||
@@ -2141,6 +2140,10 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene
|
|||||||
mGlobalActionsLayout.setRotationListener(this::onRotate);
|
mGlobalActionsLayout.setRotationListener(this::onRotate);
|
||||||
mGlobalActionsLayout.setAdapter(mAdapter);
|
mGlobalActionsLayout.setAdapter(mAdapter);
|
||||||
mContainer = findViewById(com.android.systemui.R.id.global_actions_container);
|
mContainer = findViewById(com.android.systemui.R.id.global_actions_container);
|
||||||
|
mContainer.setOnClickListener(v -> {
|
||||||
|
// TODO: add logging (b/182830510)
|
||||||
|
cancel();
|
||||||
|
});
|
||||||
|
|
||||||
View overflowButton = findViewById(
|
View overflowButton = findViewById(
|
||||||
com.android.systemui.R.id.global_actions_overflow_button);
|
com.android.systemui.R.id.global_actions_overflow_button);
|
||||||
@@ -2178,7 +2181,6 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onStart() {
|
protected void onStart() {
|
||||||
super.setCanceledOnTouchOutside(true);
|
|
||||||
super.onStart();
|
super.onStart();
|
||||||
mGlobalActionsLayout.updateList();
|
mGlobalActionsLayout.updateList();
|
||||||
|
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ public class GlobalActionsLayoutLite extends GlobalActionsLayout {
|
|||||||
com.android.systemui.R.integer.power_menu_lite_max_columns);
|
com.android.systemui.R.integer.power_menu_lite_max_columns);
|
||||||
mMaxRows = getResources().getInteger(
|
mMaxRows = getResources().getInteger(
|
||||||
com.android.systemui.R.integer.power_menu_lite_max_rows);
|
com.android.systemui.R.integer.power_menu_lite_max_rows);
|
||||||
|
setOnClickListener(v -> { }); // Prevent parent onClickListener from triggering
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
|
|||||||
Reference in New Issue
Block a user