From 3b00da2769d8c7eed8af74ffe68f03011219dd03 Mon Sep 17 00:00:00 2001 From: Will Leshner Date: Mon, 7 Aug 2023 14:52:32 -0700 Subject: [PATCH] Animate status bar alpha during dream<->lockscreen transitions. Bug: 283123378 Test: atest KeyguardTransitionScenariosTest, NotificationPanelViewControllerTest Change-Id: Ic20f42ee009ca44f14e257c460e929b96e54c15e --- .../shade/NotificationPanelViewController.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java index 416f147b74296..9d6cebe6cd3ce 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java @@ -1118,7 +1118,8 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump collectFlow(mView, mKeyguardTransitionInteractor.getDreamingToLockscreenTransition(), mDreamingToLockscreenTransition, mMainDispatcher); collectFlow(mView, mDreamingToLockscreenTransitionViewModel.getLockscreenAlpha(), - setTransitionAlpha(mNotificationStackScrollLayoutController), mMainDispatcher); + setDreamLockscreenTransitionAlpha(mNotificationStackScrollLayoutController), + mMainDispatcher); collectFlow(mView, mDreamingToLockscreenTransitionViewModel.lockscreenTranslationY( mDreamingToLockscreenTransitionTranslationY), setTransitionY(mNotificationStackScrollLayoutController), mMainDispatcher); @@ -1154,7 +1155,8 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump collectFlow(mView, mKeyguardTransitionInteractor.getLockscreenToDreamingTransition(), mLockscreenToDreamingTransition, mMainDispatcher); collectFlow(mView, mLockscreenToDreamingTransitionViewModel.getLockscreenAlpha(), - setTransitionAlpha(mNotificationStackScrollLayoutController), mMainDispatcher); + setDreamLockscreenTransitionAlpha(mNotificationStackScrollLayoutController), + mMainDispatcher); collectFlow(mView, mLockscreenToDreamingTransitionViewModel.lockscreenTranslationY( mLockscreenToDreamingTransitionTranslationY), setTransitionY(mNotificationStackScrollLayoutController), mMainDispatcher); @@ -4718,6 +4720,16 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump mCurrentPanelState = state; } + private Consumer setDreamLockscreenTransitionAlpha( + NotificationStackScrollLayoutController stackScroller) { + return (Float alpha) -> { + // Also animate the status bar's alpha during transitions between the lockscreen and + // dreams. + mKeyguardStatusBarViewController.setAlpha(alpha); + setTransitionAlpha(stackScroller).accept(alpha); + }; + } + private Consumer setTransitionAlpha( NotificationStackScrollLayoutController stackScroller) { return (Float alpha) -> {