Merge "Make control panel black" into rvc-dev am: 49a07e5bff am: 4062bb6209
Change-Id: I8fcb4de3e1160439a03049a6ed11c892af220509
This commit is contained in:
@@ -27,7 +27,7 @@
|
|||||||
android:paddingRight="@dimen/global_actions_grid_item_side_margin"
|
android:paddingRight="@dimen/global_actions_grid_item_side_margin"
|
||||||
android:layout_marginRight="3dp"
|
android:layout_marginRight="3dp"
|
||||||
android:layout_marginLeft="3dp"
|
android:layout_marginLeft="3dp"
|
||||||
android:background="@drawable/rounded_bg_full">
|
android:background="@drawable/control_background">
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="@dimen/global_actions_grid_item_width"
|
android:layout_width="@dimen/global_actions_grid_item_width"
|
||||||
android:layout_height="@dimen/global_actions_grid_item_height"
|
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_marginLeft="@dimen/global_actions_grid_item_icon_side_margin"
|
||||||
android:layout_marginRight="@dimen/global_actions_grid_item_icon_side_margin"
|
android:layout_marginRight="@dimen/global_actions_grid_item_icon_side_margin"
|
||||||
android:scaleType="centerInside"
|
android:scaleType="centerInside"
|
||||||
android:tint="@color/global_actions_text" />
|
android:tint="@color/control_default_foreground" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@*android:id/message"
|
android:id="@*android:id/message"
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:textSize="12dp"
|
android:textSize="12dp"
|
||||||
android:textColor="@color/global_actions_text"
|
android:textColor="@color/control_default_foreground"
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall" />
|
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -62,7 +62,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:textColor="@color/global_actions_text"
|
android:textColor="@color/control_default_foreground"
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall" />
|
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@@ -489,6 +489,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener,
|
|||||||
|
|
||||||
mAdapter = new MyAdapter();
|
mAdapter = new MyAdapter();
|
||||||
|
|
||||||
|
mDepthController.setShowingHomeControls(shouldShowControls());
|
||||||
ActionsDialog dialog = new ActionsDialog(mContext, mAdapter, getWalletPanelViewController(),
|
ActionsDialog dialog = new ActionsDialog(mContext, mAdapter, getWalletPanelViewController(),
|
||||||
mDepthController, mSysuiColorExtractor, mStatusBarService,
|
mDepthController, mSysuiColorExtractor, mStatusBarService,
|
||||||
mNotificationShadeWindowController,
|
mNotificationShadeWindowController,
|
||||||
@@ -1780,8 +1781,12 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener,
|
|||||||
}
|
}
|
||||||
if (mBackgroundDrawable == null) {
|
if (mBackgroundDrawable == null) {
|
||||||
mBackgroundDrawable = new ScrimDrawable();
|
mBackgroundDrawable = new ScrimDrawable();
|
||||||
mScrimAlpha = mBlurUtils.supportsBlursOnWindows()
|
if (mControlsUiController != null) {
|
||||||
? ScrimController.BLUR_SCRIM_ALPHA : ScrimController.BUSY_SCRIM_ALPHA;
|
mScrimAlpha = 1.0f;
|
||||||
|
} else {
|
||||||
|
mScrimAlpha = mBlurUtils.supportsBlursOnWindows()
|
||||||
|
? ScrimController.BLUR_SCRIM_ALPHA : ScrimController.BUSY_SCRIM_ALPHA;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
getWindow().setBackgroundDrawable(mBackgroundDrawable);
|
getWindow().setBackgroundDrawable(mBackgroundDrawable);
|
||||||
}
|
}
|
||||||
@@ -1841,8 +1846,9 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener,
|
|||||||
if (!(mBackgroundDrawable instanceof ScrimDrawable)) {
|
if (!(mBackgroundDrawable instanceof ScrimDrawable)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
((ScrimDrawable) mBackgroundDrawable).setColor(colors.supportsDarkText() ? Color.WHITE
|
boolean hasControls = mControlsUiController != null;
|
||||||
: Color.BLACK, animate);
|
((ScrimDrawable) mBackgroundDrawable).setColor(
|
||||||
|
!hasControls && colors.supportsDarkText() ? Color.WHITE : Color.BLACK, animate);
|
||||||
View decorView = getWindow().getDecorView();
|
View decorView = getWindow().getDecorView();
|
||||||
if (colors.supportsDarkText()) {
|
if (colors.supportsDarkText()) {
|
||||||
decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR |
|
decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR |
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ class NotificationShadeDepthController @Inject constructor(
|
|||||||
var shadeSpring = DepthAnimation()
|
var shadeSpring = DepthAnimation()
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
var globalActionsSpring = DepthAnimation()
|
var globalActionsSpring = DepthAnimation()
|
||||||
|
var showingHomeControls: Boolean = false
|
||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
var brightnessMirrorSpring = DepthAnimation()
|
var brightnessMirrorSpring = DepthAnimation()
|
||||||
@@ -133,7 +134,14 @@ class NotificationShadeDepthController @Inject constructor(
|
|||||||
shadeRadius = 0f
|
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)
|
blurUtils.applyBlur(blurRoot?.viewRootImpl ?: root.viewRootImpl, blur)
|
||||||
try {
|
try {
|
||||||
wallpaperManager.setWallpaperZoomOut(root.windowToken,
|
wallpaperManager.setWallpaperZoomOut(root.windowToken,
|
||||||
|
|||||||
@@ -117,11 +117,26 @@ class NotificationShadeDepthControllerTest : SysuiTestCase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun updateGlobalDialogVisibility_appliesBlur() {
|
fun updateGlobalDialogVisibility_animatesBlur() {
|
||||||
notificationShadeDepthController.updateGlobalDialogVisibility(0.5f, root)
|
notificationShadeDepthController.updateGlobalDialogVisibility(0.5f, root)
|
||||||
verify(globalActionsSpring).animateTo(eq(maxBlur / 2), safeEq(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
|
@Test
|
||||||
fun updateBlurCallback_setsBlurAndZoom() {
|
fun updateBlurCallback_setsBlurAndZoom() {
|
||||||
notificationShadeDepthController.updateBlurCallback.doFrame(0)
|
notificationShadeDepthController.updateBlurCallback.doFrame(0)
|
||||||
|
|||||||
Reference in New Issue
Block a user