summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Lucas Dupin <dupin@google.com> 2021-04-06 17:44:55 -0700
committer Lucas Dupin <dupin@google.com> 2021-04-06 17:44:55 -0700
commit7966a3ca480b3ca911e00cc5137b6887a99b729d (patch)
treef54930efb81ef4d0b93ac51679ced5a46dddbc74
parent3a5a8b856ded85df1964accf2df139e3cdaa7563 (diff)
Zoom out the wallpaper as we pull QS
Test: visual Test: NotificationShadeDepthControllerTest Fixes: 180971620 Change-Id: I60cd3d075ebfb8c54c0e9847f05ebde7e53068c5
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt10
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java5
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt7
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewTest.java4
4 files changed, 25 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt
index e27c1a21b8cb..ac9f70a4dfe9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt
@@ -107,6 +107,13 @@ class NotificationShadeDepthController @Inject constructor(
else 0)
}
+ var qsPanelExpansion = 0f
+ set(value) {
+ if (field == value) return
+ field = value
+ scheduleUpdate()
+ }
+
/**
* When launching an app from the shade, the animations progress should affect how blurry the
* shade is, overriding the expansion amount.
@@ -158,8 +165,9 @@ class NotificationShadeDepthController @Inject constructor(
updateScheduled = false
val normalizedBlurRadius = MathUtils.constrain(shadeAnimation.radius,
blurUtils.minBlurRadius, blurUtils.maxBlurRadius)
- val combinedBlur = (shadeSpring.radius * INTERACTION_BLUR_FRACTION +
+ var combinedBlur = (shadeSpring.radius * INTERACTION_BLUR_FRACTION +
normalizedBlurRadius * ANIMATION_BLUR_FRACTION).toInt()
+ combinedBlur = max(combinedBlur, blurUtils.blurRadiusOfRatio(qsPanelExpansion))
var shadeRadius = max(combinedBlur, wakeAndUnlockBlurRadius).toFloat()
shadeRadius *= 1f - brightnessMirrorSpring.ratio
val launchProgress = notificationLaunchAnimationParams?.linearProgress ?: 0f
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java
index 555df5c37ee3..6386a1b6b8ae 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java
@@ -111,6 +111,7 @@ import com.android.systemui.statusbar.GestureRecorder;
import com.android.systemui.statusbar.KeyguardAffordanceView;
import com.android.systemui.statusbar.KeyguardIndicationController;
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
+import com.android.systemui.statusbar.NotificationShadeDepthController;
import com.android.systemui.statusbar.NotificationShelfController;
import com.android.systemui.statusbar.PulseExpansionHandler;
import com.android.systemui.statusbar.RemoteInputController;
@@ -477,6 +478,7 @@ public class NotificationPanelViewController extends PanelViewController {
private final UserManager mUserManager;
private final ShadeController mShadeController;
private final MediaDataManager mMediaDataManager;
+ private NotificationShadeDepthController mDepthController;
private int mDisplayId;
/**
@@ -576,6 +578,7 @@ public class NotificationPanelViewController extends PanelViewController {
ScrimController scrimController,
UserManager userManager,
MediaDataManager mediaDataManager,
+ NotificationShadeDepthController notificationShadeDepthController,
AmbientState ambientState,
FeatureFlags featureFlags) {
super(view, falsingManager, dozeLog, keyguardStateController,
@@ -594,6 +597,7 @@ public class NotificationPanelViewController extends PanelViewController {
mNotificationIconAreaController = notificationIconAreaController;
mKeyguardStatusViewComponentFactory = keyguardStatusViewComponentFactory;
mKeyguardStatusBarViewComponentFactory = keyguardStatusBarViewComponentFactory;
+ mDepthController = notificationShadeDepthController;
mFeatureFlags = featureFlags;
mKeyguardQsUserSwitchComponentFactory = keyguardQsUserSwitchComponentFactory;
mKeyguardUserSwitcherComponentFactory = keyguardUserSwitcherComponentFactory;
@@ -1993,6 +1997,7 @@ public class NotificationPanelViewController extends PanelViewController {
mMediaHierarchyManager.setQsExpansion(qsExpansionFraction);
mScrimController.setQsExpansion(qsExpansionFraction);
mNotificationStackScrollLayoutController.setQsExpansionFraction(qsExpansionFraction);
+ mDepthController.setQsPanelExpansion(qsExpansionFraction);
}
private String determineAccessibilityPaneTitle() {
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 e65db5ea4192..2df3f7086b7e 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt
@@ -174,6 +174,13 @@ class NotificationShadeDepthControllerTest : SysuiTestCase() {
}
@Test
+ fun setQsPanelExpansion_appliesBlur() {
+ notificationShadeDepthController.qsPanelExpansion = 1f
+ notificationShadeDepthController.updateBlurCallback.doFrame(0)
+ verify(blurUtils).applyBlur(any(), eq(maxBlur))
+ }
+
+ @Test
fun updateGlobalDialogVisibility_animatesBlur() {
notificationShadeDepthController.updateGlobalDialogVisibility(0.5f, root)
verify(globalActionsSpring).animateTo(eq(maxBlur / 2), eq(root))
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewTest.java
index 6a5e6e8f9872..04ac1549e374 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewTest.java
@@ -82,6 +82,7 @@ import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.FeatureFlags;
import com.android.systemui.statusbar.KeyguardAffordanceView;
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
+import com.android.systemui.statusbar.NotificationShadeDepthController;
import com.android.systemui.statusbar.NotificationShelfController;
import com.android.systemui.statusbar.PulseExpansionHandler;
import com.android.systemui.statusbar.StatusBarStateControllerImpl;
@@ -219,6 +220,8 @@ public class NotificationPanelViewTest extends SysuiTestCase {
@Mock
private NotificationStackScrollLayoutController mNotificationStackScrollLayoutController;
@Mock
+ private NotificationShadeDepthController mNotificationShadeDepthController;
+ @Mock
private AuthController mAuthController;
@Mock
private ScrimController mScrimController;
@@ -333,6 +336,7 @@ public class NotificationPanelViewTest extends SysuiTestCase {
mScrimController,
mUserManager,
mMediaDataManager,
+ mNotificationShadeDepthController,
mAmbientState,
mFeatureFlags);
mNotificationPanelViewController.initDependencies(