Loading packages/SystemUI/res/layout/global_actions_grid_item_v2.xml +4 −4 Original line number Diff line number Diff line Loading @@ -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" Loading @@ -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" Loading @@ -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 Loading @@ -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> packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java +10 −4 Original line number Diff line number Diff line Loading @@ -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, Loading Loading @@ -1780,9 +1781,13 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, } if (mBackgroundDrawable == null) { mBackgroundDrawable = new ScrimDrawable(); if (mControlsUiController != null) { mScrimAlpha = 1.0f; } else { mScrimAlpha = mBlurUtils.supportsBlursOnWindows() ? ScrimController.BLUR_SCRIM_ALPHA : ScrimController.BUSY_SCRIM_ALPHA; } } getWindow().setBackgroundDrawable(mBackgroundDrawable); } Loading Loading @@ -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 | Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt +9 −1 Original line number Diff line number Diff line Loading @@ -74,6 +74,7 @@ class NotificationShadeDepthController @Inject constructor( var shadeSpring = DepthAnimation() @VisibleForTesting var globalActionsSpring = DepthAnimation() var showingHomeControls: Boolean = false @VisibleForTesting var brightnessMirrorSpring = DepthAnimation() Loading Loading @@ -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, Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt +16 −1 Original line number Diff line number Diff line Loading @@ -117,11 +117,26 @@ 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) Loading Loading
packages/SystemUI/res/layout/global_actions_grid_item_v2.xml +4 −4 Original line number Diff line number Diff line Loading @@ -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" Loading @@ -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" Loading @@ -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 Loading @@ -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>
packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java +10 −4 Original line number Diff line number Diff line Loading @@ -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, Loading Loading @@ -1780,9 +1781,13 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, } if (mBackgroundDrawable == null) { mBackgroundDrawable = new ScrimDrawable(); if (mControlsUiController != null) { mScrimAlpha = 1.0f; } else { mScrimAlpha = mBlurUtils.supportsBlursOnWindows() ? ScrimController.BLUR_SCRIM_ALPHA : ScrimController.BUSY_SCRIM_ALPHA; } } getWindow().setBackgroundDrawable(mBackgroundDrawable); } Loading Loading @@ -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 | Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt +9 −1 Original line number Diff line number Diff line Loading @@ -74,6 +74,7 @@ class NotificationShadeDepthController @Inject constructor( var shadeSpring = DepthAnimation() @VisibleForTesting var globalActionsSpring = DepthAnimation() var showingHomeControls: Boolean = false @VisibleForTesting var brightnessMirrorSpring = DepthAnimation() Loading Loading @@ -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, Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt +16 −1 Original line number Diff line number Diff line Loading @@ -117,11 +117,26 @@ 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) Loading