Merge "Zoom out the wallpaper as we pull QS" into sc-dev

This commit is contained in:
Lucas Dupin
2021-04-07 15:24:39 +00:00
committed by Android (Google) Code Review
4 changed files with 25 additions and 1 deletions

View File

@@ -107,6 +107,13 @@ class NotificationShadeDepthController @Inject constructor(
else 0) 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 * When launching an app from the shade, the animations progress should affect how blurry the
* shade is, overriding the expansion amount. * shade is, overriding the expansion amount.
@@ -158,8 +165,9 @@ class NotificationShadeDepthController @Inject constructor(
updateScheduled = false updateScheduled = false
val normalizedBlurRadius = MathUtils.constrain(shadeAnimation.radius, val normalizedBlurRadius = MathUtils.constrain(shadeAnimation.radius,
blurUtils.minBlurRadius, blurUtils.maxBlurRadius) blurUtils.minBlurRadius, blurUtils.maxBlurRadius)
val combinedBlur = (shadeSpring.radius * INTERACTION_BLUR_FRACTION + var combinedBlur = (shadeSpring.radius * INTERACTION_BLUR_FRACTION +
normalizedBlurRadius * ANIMATION_BLUR_FRACTION).toInt() normalizedBlurRadius * ANIMATION_BLUR_FRACTION).toInt()
combinedBlur = max(combinedBlur, blurUtils.blurRadiusOfRatio(qsPanelExpansion))
var shadeRadius = max(combinedBlur, wakeAndUnlockBlurRadius).toFloat() var shadeRadius = max(combinedBlur, wakeAndUnlockBlurRadius).toFloat()
shadeRadius *= 1f - brightnessMirrorSpring.ratio shadeRadius *= 1f - brightnessMirrorSpring.ratio
val launchProgress = notificationLaunchAnimationParams?.linearProgress ?: 0f val launchProgress = notificationLaunchAnimationParams?.linearProgress ?: 0f

View File

@@ -111,6 +111,7 @@ import com.android.systemui.statusbar.GestureRecorder;
import com.android.systemui.statusbar.KeyguardAffordanceView; import com.android.systemui.statusbar.KeyguardAffordanceView;
import com.android.systemui.statusbar.KeyguardIndicationController; import com.android.systemui.statusbar.KeyguardIndicationController;
import com.android.systemui.statusbar.NotificationLockscreenUserManager; import com.android.systemui.statusbar.NotificationLockscreenUserManager;
import com.android.systemui.statusbar.NotificationShadeDepthController;
import com.android.systemui.statusbar.NotificationShelfController; import com.android.systemui.statusbar.NotificationShelfController;
import com.android.systemui.statusbar.PulseExpansionHandler; import com.android.systemui.statusbar.PulseExpansionHandler;
import com.android.systemui.statusbar.RemoteInputController; import com.android.systemui.statusbar.RemoteInputController;
@@ -481,6 +482,7 @@ public class NotificationPanelViewController extends PanelViewController {
private final UserManager mUserManager; private final UserManager mUserManager;
private final ShadeController mShadeController; private final ShadeController mShadeController;
private final MediaDataManager mMediaDataManager; private final MediaDataManager mMediaDataManager;
private NotificationShadeDepthController mDepthController;
private int mDisplayId; private int mDisplayId;
/** /**
@@ -580,6 +582,7 @@ public class NotificationPanelViewController extends PanelViewController {
ScrimController scrimController, ScrimController scrimController,
UserManager userManager, UserManager userManager,
MediaDataManager mediaDataManager, MediaDataManager mediaDataManager,
NotificationShadeDepthController notificationShadeDepthController,
AmbientState ambientState, AmbientState ambientState,
FeatureFlags featureFlags) { FeatureFlags featureFlags) {
super(view, falsingManager, dozeLog, keyguardStateController, super(view, falsingManager, dozeLog, keyguardStateController,
@@ -598,6 +601,7 @@ public class NotificationPanelViewController extends PanelViewController {
mNotificationIconAreaController = notificationIconAreaController; mNotificationIconAreaController = notificationIconAreaController;
mKeyguardStatusViewComponentFactory = keyguardStatusViewComponentFactory; mKeyguardStatusViewComponentFactory = keyguardStatusViewComponentFactory;
mKeyguardStatusBarViewComponentFactory = keyguardStatusBarViewComponentFactory; mKeyguardStatusBarViewComponentFactory = keyguardStatusBarViewComponentFactory;
mDepthController = notificationShadeDepthController;
mFeatureFlags = featureFlags; mFeatureFlags = featureFlags;
mKeyguardQsUserSwitchComponentFactory = keyguardQsUserSwitchComponentFactory; mKeyguardQsUserSwitchComponentFactory = keyguardQsUserSwitchComponentFactory;
mKeyguardUserSwitcherComponentFactory = keyguardUserSwitcherComponentFactory; mKeyguardUserSwitcherComponentFactory = keyguardUserSwitcherComponentFactory;
@@ -1997,6 +2001,7 @@ public class NotificationPanelViewController extends PanelViewController {
mMediaHierarchyManager.setQsExpansion(qsExpansionFraction); mMediaHierarchyManager.setQsExpansion(qsExpansionFraction);
mScrimController.setQsExpansion(qsExpansionFraction); mScrimController.setQsExpansion(qsExpansionFraction);
mNotificationStackScrollLayoutController.setQsExpansionFraction(qsExpansionFraction); mNotificationStackScrollLayoutController.setQsExpansionFraction(qsExpansionFraction);
mDepthController.setQsPanelExpansion(qsExpansionFraction);
} }
private String determineAccessibilityPaneTitle() { private String determineAccessibilityPaneTitle() {

View File

@@ -173,6 +173,13 @@ class NotificationShadeDepthControllerTest : SysuiTestCase() {
verify(shadeAnimation).animateTo(eq(0), any()) verify(shadeAnimation).animateTo(eq(0), any())
} }
@Test
fun setQsPanelExpansion_appliesBlur() {
notificationShadeDepthController.qsPanelExpansion = 1f
notificationShadeDepthController.updateBlurCallback.doFrame(0)
verify(blurUtils).applyBlur(any(), eq(maxBlur))
}
@Test @Test
fun updateGlobalDialogVisibility_animatesBlur() { fun updateGlobalDialogVisibility_animatesBlur() {
notificationShadeDepthController.updateGlobalDialogVisibility(0.5f, root) notificationShadeDepthController.updateGlobalDialogVisibility(0.5f, root)

View File

@@ -82,6 +82,7 @@ import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.FeatureFlags; import com.android.systemui.statusbar.FeatureFlags;
import com.android.systemui.statusbar.KeyguardAffordanceView; import com.android.systemui.statusbar.KeyguardAffordanceView;
import com.android.systemui.statusbar.NotificationLockscreenUserManager; import com.android.systemui.statusbar.NotificationLockscreenUserManager;
import com.android.systemui.statusbar.NotificationShadeDepthController;
import com.android.systemui.statusbar.NotificationShelfController; import com.android.systemui.statusbar.NotificationShelfController;
import com.android.systemui.statusbar.PulseExpansionHandler; import com.android.systemui.statusbar.PulseExpansionHandler;
import com.android.systemui.statusbar.StatusBarStateControllerImpl; import com.android.systemui.statusbar.StatusBarStateControllerImpl;
@@ -219,6 +220,8 @@ public class NotificationPanelViewTest extends SysuiTestCase {
@Mock @Mock
private NotificationStackScrollLayoutController mNotificationStackScrollLayoutController; private NotificationStackScrollLayoutController mNotificationStackScrollLayoutController;
@Mock @Mock
private NotificationShadeDepthController mNotificationShadeDepthController;
@Mock
private AuthController mAuthController; private AuthController mAuthController;
@Mock @Mock
private ScrimController mScrimController; private ScrimController mScrimController;
@@ -333,6 +336,7 @@ public class NotificationPanelViewTest extends SysuiTestCase {
mScrimController, mScrimController,
mUserManager, mUserManager,
mMediaDataManager, mMediaDataManager,
mNotificationShadeDepthController,
mAmbientState, mAmbientState,
mFeatureFlags); mFeatureFlags);
mNotificationPanelViewController.initDependencies( mNotificationPanelViewController.initDependencies(