diff options
4 files changed, 39 insertions, 10 deletions
diff --git a/packages/SystemUI/res/layout/global_actions_grid_item_v2.xml b/packages/SystemUI/res/layout/global_actions_grid_item_v2.xml index 50aa212c94a6..cb53fe619b24 100644 --- a/packages/SystemUI/res/layout/global_actions_grid_item_v2.xml +++ b/packages/SystemUI/res/layout/global_actions_grid_item_v2.xml @@ -27,7 +27,7 @@ android:paddingRight="@dimen/global_actions_grid_item_side_margin" android:layout_marginRight="3dp" android:layout_marginLeft="3dp" - android:background="@drawable/rounded_bg_full"> + android:background="@drawable/control_background"> <LinearLayout android:layout_width="@dimen/global_actions_grid_item_width" android:layout_height="@dimen/global_actions_grid_item_height" @@ -42,7 +42,7 @@ android:layout_marginLeft="@dimen/global_actions_grid_item_icon_side_margin" android:layout_marginRight="@dimen/global_actions_grid_item_icon_side_margin" android:scaleType="centerInside" - android:tint="@color/global_actions_text" /> + android:tint="@color/control_default_foreground" /> <TextView android:id="@*android:id/message" @@ -53,7 +53,7 @@ android:singleLine="true" android:gravity="center" android:textSize="12dp" - android:textColor="@color/global_actions_text" + android:textColor="@color/control_default_foreground" android:textAppearance="?android:attr/textAppearanceSmall" /> <TextView @@ -62,7 +62,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" - android:textColor="@color/global_actions_text" + android:textColor="@color/control_default_foreground" android:textAppearance="?android:attr/textAppearanceSmall" /> </LinearLayout> </LinearLayout> diff --git a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java index fdd859373685..4dd5e87d2c93 100644 --- a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java +++ b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java @@ -489,6 +489,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, mAdapter = new MyAdapter(); + mDepthController.setShowingHomeControls(shouldShowControls()); ActionsDialog dialog = new ActionsDialog(mContext, mAdapter, getWalletPanelViewController(), mDepthController, mSysuiColorExtractor, mStatusBarService, mNotificationShadeWindowController, @@ -1780,8 +1781,12 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, } if (mBackgroundDrawable == null) { mBackgroundDrawable = new ScrimDrawable(); - mScrimAlpha = mBlurUtils.supportsBlursOnWindows() - ? ScrimController.BLUR_SCRIM_ALPHA : ScrimController.BUSY_SCRIM_ALPHA; + if (mControlsUiController != null) { + mScrimAlpha = 1.0f; + } else { + mScrimAlpha = mBlurUtils.supportsBlursOnWindows() + ? ScrimController.BLUR_SCRIM_ALPHA : ScrimController.BUSY_SCRIM_ALPHA; + } } getWindow().setBackgroundDrawable(mBackgroundDrawable); } @@ -1841,8 +1846,9 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, if (!(mBackgroundDrawable instanceof ScrimDrawable)) { return; } - ((ScrimDrawable) mBackgroundDrawable).setColor(colors.supportsDarkText() ? Color.WHITE - : Color.BLACK, animate); + boolean hasControls = mControlsUiController != null; + ((ScrimDrawable) mBackgroundDrawable).setColor( + !hasControls && colors.supportsDarkText() ? Color.WHITE : Color.BLACK, animate); View decorView = getWindow().getDecorView(); if (colors.supportsDarkText()) { decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR | diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt index fd44f04a0d80..d2da2628276a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt @@ -74,6 +74,7 @@ class NotificationShadeDepthController @Inject constructor( var shadeSpring = DepthAnimation() @VisibleForTesting var globalActionsSpring = DepthAnimation() + var showingHomeControls: Boolean = false @VisibleForTesting var brightnessMirrorSpring = DepthAnimation() @@ -133,7 +134,14 @@ class NotificationShadeDepthController @Inject constructor( shadeRadius = 0f } } - val blur = max(shadeRadius.toInt(), globalActionsSpring.radius) + + // Home controls have black background, this means that we should not have blur when they + // are fully visible, otherwise we'll enter Client Composition unnecessarily. + var globalActionsRadius = globalActionsSpring.radius + if (showingHomeControls) { + globalActionsRadius = 0 + } + val blur = max(shadeRadius.toInt(), globalActionsRadius) blurUtils.applyBlur(blurRoot?.viewRootImpl ?: root.viewRootImpl, blur) try { wallpaperManager.setWallpaperZoomOut(root.windowToken, diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt index 6b7a3bfce5ad..c874915e9124 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt @@ -117,12 +117,27 @@ class NotificationShadeDepthControllerTest : SysuiTestCase() { } @Test - fun updateGlobalDialogVisibility_appliesBlur() { + fun updateGlobalDialogVisibility_animatesBlur() { notificationShadeDepthController.updateGlobalDialogVisibility(0.5f, root) verify(globalActionsSpring).animateTo(eq(maxBlur / 2), safeEq(root)) } @Test + fun updateGlobalDialogVisibility_appliesBlur_withoutHomeControls() { + `when`(globalActionsSpring.radius).thenReturn(maxBlur) + notificationShadeDepthController.updateBlurCallback.doFrame(0) + verify(blurUtils).applyBlur(any(), eq(maxBlur)) + } + + @Test + fun updateGlobalDialogVisibility_appliesBlur_unlessHomeControls() { + notificationShadeDepthController.showingHomeControls = true + `when`(globalActionsSpring.radius).thenReturn(maxBlur) + notificationShadeDepthController.updateBlurCallback.doFrame(0) + verify(blurUtils).applyBlur(any(), eq(0)) + } + + @Test fun updateBlurCallback_setsBlurAndZoom() { notificationShadeDepthController.updateBlurCallback.doFrame(0) verify(wallpaperManager).setWallpaperZoomOut(any(), anyFloat()) |