diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationLaunchAnimatorController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationLaunchAnimatorController.kt index 0b6a5c9703f42..d925a93d982a8 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationLaunchAnimatorController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationLaunchAnimatorController.kt @@ -6,7 +6,6 @@ import com.android.systemui.animation.ActivityLaunchAnimator import com.android.systemui.statusbar.NotificationShadeDepthController import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow import com.android.systemui.statusbar.notification.stack.NotificationListContainer -import com.android.systemui.statusbar.phone.NotificationPanelViewController import com.android.systemui.statusbar.phone.NotificationShadeWindowViewController import kotlin.math.ceil import kotlin.math.max @@ -14,7 +13,6 @@ import kotlin.math.max /** A provider of [NotificationLaunchAnimatorController]. */ class NotificationLaunchAnimatorControllerProvider( private val notificationShadeWindowViewController: NotificationShadeWindowViewController, - private val notificationPanelViewController: NotificationPanelViewController, private val notificationListContainer: NotificationListContainer, private val depthController: NotificationShadeDepthController ) { @@ -23,7 +21,6 @@ class NotificationLaunchAnimatorControllerProvider( ): NotificationLaunchAnimatorController { return NotificationLaunchAnimatorController( notificationShadeWindowViewController, - notificationPanelViewController, notificationListContainer, depthController, notification @@ -38,7 +35,6 @@ class NotificationLaunchAnimatorControllerProvider( */ class NotificationLaunchAnimatorController( private val notificationShadeWindowViewController: NotificationShadeWindowViewController, - private val notificationPanelViewController: NotificationPanelViewController, private val notificationListContainer: NotificationListContainer, private val depthController: NotificationShadeDepthController, private val notification: ExpandableNotificationRow @@ -97,7 +93,6 @@ class NotificationLaunchAnimatorController( } override fun onLaunchAnimationStart(isExpandingFullyAbove: Boolean) { - notificationPanelViewController.setLaunchingNotification(true) notification.isExpandAnimationRunning = true notificationListContainer.setExpandingNotification(notification) @@ -108,7 +103,6 @@ class NotificationLaunchAnimatorController( override fun onLaunchAnimationEnd(isExpandingFullyAbove: Boolean) { InteractionJankMonitor.getInstance().end(InteractionJankMonitor.CUJ_NOTIFICATION_APP_START) - notificationPanelViewController.setLaunchingNotification(false) notification.isExpandAnimationRunning = false notificationShadeWindowViewController.setExpandAnimationRunning(false) notificationListContainer.setExpandingNotification(null) @@ -118,7 +112,6 @@ class NotificationLaunchAnimatorController( private fun applyParams(params: ExpandAnimationParameters?) { notification.applyExpandAnimationParams(params) notificationListContainer.applyExpandAnimationParams(params) - notificationPanelViewController.applyExpandAnimationParams(params) depthController.notificationLaunchAnimationParams = params } 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 6a35293def766..12563052ccf14 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java @@ -122,7 +122,6 @@ import com.android.systemui.statusbar.VibratorHelper; import com.android.systemui.statusbar.notification.AnimatableProperty; import com.android.systemui.statusbar.notification.ConversationNotificationManager; import com.android.systemui.statusbar.notification.DynamicPrivacyController; -import com.android.systemui.statusbar.notification.ExpandAnimationParameters; import com.android.systemui.statusbar.notification.NotificationEntryManager; import com.android.systemui.statusbar.notification.NotificationWakeUpCoordinator; import com.android.systemui.statusbar.notification.PropertyAnimator; @@ -183,7 +182,7 @@ public class NotificationPanelViewController extends PanelViewController { private static final int FLING_HIDE = 2; private static final long ANIMATION_DELAY_ICON_FADE_IN = ActivityLaunchAnimator.ANIMATION_DURATION - CollapsedStatusBarFragment.FADE_IN_DURATION - - CollapsedStatusBarFragment.FADE_IN_DELAY - 16; + - CollapsedStatusBarFragment.FADE_IN_DELAY - 48; private final DozeParameters mDozeParameters; private final OnHeightChangedListener mOnHeightChangedListener = new OnHeightChangedListener(); @@ -444,7 +443,7 @@ public class NotificationPanelViewController extends PanelViewController { private LockscreenGestureLogger mLockscreenGestureLogger = new LockscreenGestureLogger(); private boolean mUserSetupComplete; private int mQsNotificationTopPadding; - private boolean mHideIconsDuringNotificationLaunch = true; + private boolean mHideIconsDuringLaunchAnimation = true; private int mStackScrollerMeasuringPass; private ArrayList> mTrackingHeadsUpListeners = @@ -3089,8 +3088,8 @@ public class NotificationPanelViewController extends PanelViewController { } public boolean hideStatusBarIconsWhenExpanded() { - if (mLaunchingNotification) { - return mHideIconsDuringNotificationLaunch; + if (mIsLaunchAnimationRunning) { + return mHideIconsDuringLaunchAnimation; } if (mHeadsUpAppearanceController != null && mHeadsUpAppearanceController.shouldBeVisible()) { @@ -3219,14 +3218,11 @@ public class NotificationPanelViewController extends PanelViewController { mKeyguardBottomArea.setUserSetupComplete(userSetupComplete); } - public void applyExpandAnimationParams(ExpandAnimationParameters params) { - if (params == null) { - return; - } - - boolean hideIcons = params.getProgress(ANIMATION_DELAY_ICON_FADE_IN, 100) == 0.0f; - if (hideIcons != mHideIconsDuringNotificationLaunch) { - mHideIconsDuringNotificationLaunch = hideIcons; + public void applyLaunchAnimationProgress(float linearProgress) { + boolean hideIcons = ActivityLaunchAnimator.getProgress(linearProgress, + ANIMATION_DELAY_ICON_FADE_IN, 100) == 0.0f; + if (hideIcons != mHideIconsDuringLaunchAnimation) { + mHideIconsDuringLaunchAnimation = hideIcons; if (!hideIcons) { mCommandQueue.recomputeDisableFlags(mDisplayId, true /* animate */); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java index a80e270f38c67..064086a828cb3 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java @@ -83,7 +83,7 @@ public abstract class PanelViewController { private LockscreenGestureLogger mLockscreenGestureLogger = new LockscreenGestureLogger(); private boolean mPanelUpdateWhenAnimatorEnds; private boolean mVibrateOnOpening; - protected boolean mLaunchingNotification; + protected boolean mIsLaunchAnimationRunning; private int mFixedDuration = NO_FIXED_DURATION; protected ArrayList mExpansionListeners = new ArrayList<>(); @@ -830,7 +830,7 @@ public abstract class PanelViewController { } public boolean isCollapsing() { - return mClosing || mLaunchingNotification; + return mClosing || mIsLaunchAnimationRunning; } public boolean isTracking() { @@ -1130,8 +1130,8 @@ public abstract class PanelViewController { mHeadsUpManager = headsUpManager; } - public void setLaunchingNotification(boolean launchingNotification) { - mLaunchingNotification = launchingNotification; + public void setIsLaunchAnimationRunning(boolean running) { + mIsLaunchAnimationRunning = running; } public void collapseWithDuration(int animationDuration) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java index d386ebde26bfd..4d8229097d209 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java @@ -1375,7 +1375,6 @@ public class StatusBar extends SystemUI implements DemoMode, mActivityLaunchAnimator = new ActivityLaunchAnimator(mContext); mNotificationAnimationProvider = new NotificationLaunchAnimatorControllerProvider( mNotificationShadeWindowViewController, - mNotificationPanelViewController, mStackScrollerController.getNotificationListContainer(), mNotificationShadeDepthControllerLazy.get() ); @@ -1589,6 +1588,10 @@ public class StatusBar extends SystemUI implements DemoMode, return mNotificationShadeWindowViewController; } + public NotificationPanelViewController getNotificationPanelViewController() { + return mNotificationPanelViewController; + } + protected ViewGroup getBouncerContainer() { return mNotificationShadeWindowView; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarLaunchAnimatorController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarLaunchAnimatorController.kt index 2f52158c40dba..4a56020aebce9 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarLaunchAnimatorController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarLaunchAnimatorController.kt @@ -20,6 +20,7 @@ class StatusBarLaunchAnimatorController( override fun onLaunchAnimationStart(isExpandingFullyAbove: Boolean) { delegate.onLaunchAnimationStart(isExpandingFullyAbove) + statusBar.notificationPanelViewController.setIsLaunchAnimationRunning(true) if (!isExpandingFullyAbove) { statusBar.collapsePanelWithDuration(ActivityLaunchAnimator.ANIMATION_DURATION.toInt()) } @@ -28,6 +29,16 @@ class StatusBarLaunchAnimatorController( override fun onLaunchAnimationEnd(isExpandingFullyAbove: Boolean) { delegate.onLaunchAnimationEnd(isExpandingFullyAbove) statusBar.onLaunchAnimationEnd(isExpandingFullyAbove) + statusBar.notificationPanelViewController.setIsLaunchAnimationRunning(false) + } + + override fun onLaunchAnimationProgress( + state: ActivityLaunchAnimator.State, + progress: Float, + linearProgress: Float + ) { + delegate.onLaunchAnimationProgress(state, progress, linearProgress) + statusBar.notificationPanelViewController.applyLaunchAnimationProgress(linearProgress) } override fun onLaunchAnimationCancelled() {