Loading packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +37 −10 Original line number Diff line number Diff line Loading @@ -191,6 +191,7 @@ import com.android.systemui.statusbar.notification.PropertyAnimator; import com.android.systemui.statusbar.notification.ViewGroupFadeHelper; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.domain.interactor.ActiveNotificationsInteractor; import com.android.systemui.statusbar.notification.domain.interactor.HeadsUpNotificationInteractor; import com.android.systemui.statusbar.notification.footer.shared.FooterViewRefactor; import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; import com.android.systemui.statusbar.notification.row.ExpandableView; Loading Loading @@ -438,6 +439,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump private boolean mExpandingFromHeadsUp; private boolean mCollapsedOnDown; private boolean mClosingWithAlphaFadeOut; private boolean mHeadsUpVisible; private boolean mHeadsUpAnimatingAway; private final FalsingManager mFalsingManager; private final FalsingCollector mFalsingCollector; Loading Loading @@ -605,6 +607,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump private final PrimaryBouncerToGoneTransitionViewModel mPrimaryBouncerToGoneTransitionViewModel; private final SharedNotificationContainerInteractor mSharedNotificationContainerInteractor; private final ActiveNotificationsInteractor mActiveNotificationsInteractor; private final HeadsUpNotificationInteractor mHeadsUpNotificationInteractor; private final KeyguardTransitionInteractor mKeyguardTransitionInteractor; private final KeyguardInteractor mKeyguardInteractor; private final PowerInteractor mPowerInteractor; Loading Loading @@ -770,6 +773,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump ActivityStarter activityStarter, SharedNotificationContainerInteractor sharedNotificationContainerInteractor, ActiveNotificationsInteractor activeNotificationsInteractor, HeadsUpNotificationInteractor headsUpNotificationInteractor, ShadeAnimationInteractor shadeAnimationInteractor, KeyguardViewConfigurator keyguardViewConfigurator, DeviceEntryFaceAuthInteractor deviceEntryFaceAuthInteractor, Loading Loading @@ -804,6 +808,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump mKeyguardTransitionInteractor = keyguardTransitionInteractor; mSharedNotificationContainerInteractor = sharedNotificationContainerInteractor; mActiveNotificationsInteractor = activeNotificationsInteractor; mHeadsUpNotificationInteractor = headsUpNotificationInteractor; mKeyguardInteractor = keyguardInteractor; mPowerInteractor = powerInteractor; mKeyguardViewConfigurator = keyguardViewConfigurator; Loading Loading @@ -1216,6 +1221,11 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump } }, mMainDispatcher); if (NotificationsHeadsUpRefactor.isEnabled()) { collectFlow(mView, mHeadsUpNotificationInteractor.isHeadsUpOrAnimatingAway(), setHeadsUpVisible(), mMainDispatcher); } } @VisibleForTesting Loading Loading @@ -3055,7 +3065,21 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump mPanelAlphaEndAction = r; } private Consumer<Boolean> setHeadsUpVisible() { return (Boolean isHeadsUpVisible) -> { mHeadsUpVisible = isHeadsUpVisible; if (isHeadsUpVisible) { updateNotificationTranslucency(); } updateExpansionAndVisibility(); updateGestureExclusionRect(); mKeyguardStatusBarViewController.updateForHeadsUp(); }; } private void setHeadsUpAnimatingAway(boolean headsUpAnimatingAway) { NotificationsHeadsUpRefactor.assertInLegacyMode(); mHeadsUpAnimatingAway = headsUpAnimatingAway; mNotificationStackScrollLayoutController.setHeadsUpAnimatingAway(headsUpAnimatingAway); updateVisibility(); Loading @@ -3071,13 +3095,16 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump } private boolean shouldPanelBeVisible() { boolean headsUpVisible = mHeadsUpAnimatingAway || mHeadsUpPinnedMode; boolean headsUpVisible = NotificationsHeadsUpRefactor.isEnabled() ? mHeadsUpVisible : (mHeadsUpAnimatingAway || mHeadsUpPinnedMode); return headsUpVisible || isExpanded() || mBouncerShowing; } private void setHeadsUpManager(HeadsUpManager headsUpManager) { mHeadsUpManager = headsUpManager; if (!NotificationsHeadsUpRefactor.isEnabled()) { mHeadsUpManager.addListener(mOnHeadsUpChangedListener); } mHeadsUpTouchHelper = new HeadsUpTouchHelper( headsUpManager, mStatusBarService, Loading Loading @@ -3165,8 +3192,9 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump } private boolean isPanelVisibleBecauseOfHeadsUp() { return (mHeadsUpManager.hasPinnedHeadsUp() || mHeadsUpAnimatingAway) && mBarState == StatusBarState.SHADE; boolean headsUpVisible = NotificationsHeadsUpRefactor.isEnabled() ? mHeadsUpVisible : (mHeadsUpManager.hasPinnedHeadsUp() || mHeadsUpAnimatingAway); return headsUpVisible && mBarState == StatusBarState.SHADE; } private boolean isPanelVisibleBecauseScrimIsAnimatingOff() { Loading Loading @@ -3479,6 +3507,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump ipw.print("mExpandingFromHeadsUp="); ipw.println(mExpandingFromHeadsUp); ipw.print("mCollapsedOnDown="); ipw.println(mCollapsedOnDown); ipw.print("mClosingWithAlphaFadeOut="); ipw.println(mClosingWithAlphaFadeOut); ipw.print("mHeadsUpVisible="); ipw.println(mHeadsUpVisible); ipw.print("mHeadsUpAnimatingAway="); ipw.println(mHeadsUpAnimatingAway); ipw.print("mShowIconsWhenExpanded="); ipw.println(mShowIconsWhenExpanded); ipw.print("mIndicationBottomPadding="); ipw.println(mIndicationBottomPadding); Loading Loading @@ -4384,6 +4413,8 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump private final class ShadeHeadsUpChangedListener implements OnHeadsUpChangedListener { @Override public void onHeadsUpPinnedModeChanged(final boolean inPinnedMode) { NotificationsHeadsUpRefactor.assertInLegacyMode(); if (inPinnedMode) { mHeadsUpExistenceChangedRunnable.run(); updateNotificationTranslucency(); Loading @@ -4400,9 +4431,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump @Override public void onHeadsUpPinned(NotificationEntry entry) { if (NotificationsHeadsUpRefactor.isEnabled()) { return; } NotificationsHeadsUpRefactor.assertInLegacyMode(); if (!isKeyguardShowing()) { mNotificationStackScrollLayoutController.generateHeadsUpAnimation(entry, true); Loading @@ -4411,9 +4440,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump @Override public void onHeadsUpUnPinned(NotificationEntry entry) { if (NotificationsHeadsUpRefactor.isEnabled()) { return; } NotificationsHeadsUpRefactor.assertInLegacyMode(); // When we're unpinning the notification via active edge they remain heads-upped, // we need to make sure that an animation happens in this case, otherwise the Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/data/repository/HeadsUpRepository.kt +4 −1 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.statusbar.notification.data.repository import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.StateFlow /** * A repository of currently displayed heads up notifications. Loading @@ -31,11 +32,13 @@ interface HeadsUpRepository { * True if we are exiting the headsUp pinned mode, and some notifications might still be * animating out. This is used to keep their view container visible. */ val isHeadsUpAnimatingAway: Flow<Boolean> val isHeadsUpAnimatingAway: StateFlow<Boolean> /** The heads up row that should be displayed on top. */ val topHeadsUpRow: Flow<HeadsUpRowRepository?> /** Set of currently active top-level heads up rows to be displayed. */ val activeHeadsUpRows: Flow<Set<HeadsUpRowRepository>> fun setHeadsUpAnimatingAway(animatingAway: Boolean) } packages/SystemUI/src/com/android/systemui/statusbar/notification/domain/interactor/HeadsUpNotificationInteractor.kt +4 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ import kotlinx.coroutines.flow.flatMapLatest import kotlinx.coroutines.flow.flowOf import kotlinx.coroutines.flow.map class HeadsUpNotificationInteractor @Inject constructor(repository: HeadsUpRepository) { class HeadsUpNotificationInteractor @Inject constructor(private val repository: HeadsUpRepository) { val topHeadsUpRow: Flow<HeadsUpRowKey?> = repository.topHeadsUpRow Loading Loading @@ -67,6 +67,9 @@ class HeadsUpNotificationInteractor @Inject constructor(repository: HeadsUpRepos fun headsUpRow(key: HeadsUpRowKey): HeadsUpRowInteractor = HeadsUpRowInteractor(key as HeadsUpRowRepository) fun elementKeyFor(key: HeadsUpRowKey) = (key as HeadsUpRowRepository).elementKey fun setHeadsUpAnimatingAway(animatingAway: Boolean) { repository.setHeadsUpAnimatingAway(animatingAway) } } class HeadsUpRowInteractor(repository: HeadsUpRowRepository) packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +37 −3 Original line number Diff line number Diff line Loading @@ -111,6 +111,7 @@ import com.android.systemui.statusbar.notification.row.ActivatableNotificationVi import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; import com.android.systemui.statusbar.notification.row.ExpandableView; import com.android.systemui.statusbar.notification.row.StackScrollerDecorView; import com.android.systemui.statusbar.notification.shared.NotificationsHeadsUpRefactor; import com.android.systemui.statusbar.notification.shared.NotificationsImprovedHunAnimation; import com.android.systemui.statusbar.notification.shared.NotificationsLiveDataStoreRefactor; import com.android.systemui.statusbar.notification.stack.shared.model.ShadeScrimBounds; Loading Loading @@ -450,7 +451,9 @@ public class NotificationStackScrollLayout private boolean mIsClipped; private Rect mRequestedClipBounds; private boolean mInHeadsUpPinnedMode; private boolean mHeadsUpAnimatingAway; @VisibleForTesting boolean mHeadsUpAnimatingAway; private Consumer<Boolean> mHeadsUpAnimatingAwayListener; private int mStatusBarState; private int mUpcomingStatusBarState; private boolean mHeadsUpGoingAwayAnimationsAllowed = true; Loading Loading @@ -4084,7 +4087,14 @@ public class NotificationStackScrollLayout mSwipeHelper.setIsExpanded(isExpanded); if (changed) { mWillExpand = false; if (!mIsExpanded) { if (mIsExpanded) { // Resetting headsUpAnimatingAway on Shade expansion avoids delays caused by // waiting for all child animations to finish. // TODO(b/328390331) Do we need to reset this on QS expanded as well? if (NotificationsHeadsUpRefactor.isEnabled()) { setHeadsUpAnimatingAway(false); } } else { mGroupExpansionManager.collapseGroups(); mExpandHelper.cancelImmediately(); if (!mIsExpansionChanging) { Loading Loading @@ -4190,6 +4200,9 @@ public class NotificationStackScrollLayout void onChildAnimationFinished() { setAnimationRunning(false); if (NotificationsHeadsUpRefactor.isEnabled()) { setHeadsUpAnimatingAway(false); } requestChildrenUpdate(); runAnimationFinishedRunnables(); clearTransient(); Loading Loading @@ -4717,6 +4730,7 @@ public class NotificationStackScrollLayout } public void generateHeadsUpAnimation(NotificationEntry entry, boolean isHeadsUp) { NotificationsHeadsUpRefactor.assertInLegacyMode(); ExpandableNotificationRow row = entry.getHeadsUpAnimationView(); generateHeadsUpAnimation(row, isHeadsUp); } Loading Loading @@ -4750,6 +4764,9 @@ public class NotificationStackScrollLayout mNeedsAnimation = true; if (!mIsExpanded && !mWillExpand && !isHeadsUp) { row.setHeadsUpAnimatingAway(true); if (NotificationsHeadsUpRefactor.isEnabled()) { setHeadsUpAnimatingAway(true); } } requestChildrenUpdate(); } Loading Loading @@ -4939,11 +4956,28 @@ public class NotificationStackScrollLayout updateClipping(); } /** TODO(b/328390331) make this private, when {@link NotificationsHeadsUpRefactor} is removed */ public void setHeadsUpAnimatingAway(boolean headsUpAnimatingAway) { if (mHeadsUpAnimatingAway != headsUpAnimatingAway) { mHeadsUpAnimatingAway = headsUpAnimatingAway; if (mHeadsUpAnimatingAwayListener != null) { mHeadsUpAnimatingAwayListener.accept(headsUpAnimatingAway); } } updateClipping(); } /** * Sets a listener to be notified about the heads up disappear animation state changes. If there * are overlapping animations, it will receive updates when the first disappar animation has * started, and when the last has finished. * * @param headsUpAnimatingAwayListener to be notified about disappear animation state changes. */ public void setHeadsUpAnimatingAwayListener( Consumer<Boolean> headsUpAnimatingAwayListener) { mHeadsUpAnimatingAwayListener = headsUpAnimatingAwayListener; } @VisibleForTesting public void setStatusBarState(int statusBarState) { mStatusBarState = statusBarState; Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java +1 −0 Original line number Diff line number Diff line Loading @@ -1482,6 +1482,7 @@ public class NotificationStackScrollLayoutController implements Dumpable { } public void setHeadsUpAnimatingAway(boolean headsUpAnimatingAway) { NotificationsHeadsUpRefactor.assertInLegacyMode(); mView.setHeadsUpAnimatingAway(headsUpAnimatingAway); } Loading Loading
packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +37 −10 Original line number Diff line number Diff line Loading @@ -191,6 +191,7 @@ import com.android.systemui.statusbar.notification.PropertyAnimator; import com.android.systemui.statusbar.notification.ViewGroupFadeHelper; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.domain.interactor.ActiveNotificationsInteractor; import com.android.systemui.statusbar.notification.domain.interactor.HeadsUpNotificationInteractor; import com.android.systemui.statusbar.notification.footer.shared.FooterViewRefactor; import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; import com.android.systemui.statusbar.notification.row.ExpandableView; Loading Loading @@ -438,6 +439,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump private boolean mExpandingFromHeadsUp; private boolean mCollapsedOnDown; private boolean mClosingWithAlphaFadeOut; private boolean mHeadsUpVisible; private boolean mHeadsUpAnimatingAway; private final FalsingManager mFalsingManager; private final FalsingCollector mFalsingCollector; Loading Loading @@ -605,6 +607,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump private final PrimaryBouncerToGoneTransitionViewModel mPrimaryBouncerToGoneTransitionViewModel; private final SharedNotificationContainerInteractor mSharedNotificationContainerInteractor; private final ActiveNotificationsInteractor mActiveNotificationsInteractor; private final HeadsUpNotificationInteractor mHeadsUpNotificationInteractor; private final KeyguardTransitionInteractor mKeyguardTransitionInteractor; private final KeyguardInteractor mKeyguardInteractor; private final PowerInteractor mPowerInteractor; Loading Loading @@ -770,6 +773,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump ActivityStarter activityStarter, SharedNotificationContainerInteractor sharedNotificationContainerInteractor, ActiveNotificationsInteractor activeNotificationsInteractor, HeadsUpNotificationInteractor headsUpNotificationInteractor, ShadeAnimationInteractor shadeAnimationInteractor, KeyguardViewConfigurator keyguardViewConfigurator, DeviceEntryFaceAuthInteractor deviceEntryFaceAuthInteractor, Loading Loading @@ -804,6 +808,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump mKeyguardTransitionInteractor = keyguardTransitionInteractor; mSharedNotificationContainerInteractor = sharedNotificationContainerInteractor; mActiveNotificationsInteractor = activeNotificationsInteractor; mHeadsUpNotificationInteractor = headsUpNotificationInteractor; mKeyguardInteractor = keyguardInteractor; mPowerInteractor = powerInteractor; mKeyguardViewConfigurator = keyguardViewConfigurator; Loading Loading @@ -1216,6 +1221,11 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump } }, mMainDispatcher); if (NotificationsHeadsUpRefactor.isEnabled()) { collectFlow(mView, mHeadsUpNotificationInteractor.isHeadsUpOrAnimatingAway(), setHeadsUpVisible(), mMainDispatcher); } } @VisibleForTesting Loading Loading @@ -3055,7 +3065,21 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump mPanelAlphaEndAction = r; } private Consumer<Boolean> setHeadsUpVisible() { return (Boolean isHeadsUpVisible) -> { mHeadsUpVisible = isHeadsUpVisible; if (isHeadsUpVisible) { updateNotificationTranslucency(); } updateExpansionAndVisibility(); updateGestureExclusionRect(); mKeyguardStatusBarViewController.updateForHeadsUp(); }; } private void setHeadsUpAnimatingAway(boolean headsUpAnimatingAway) { NotificationsHeadsUpRefactor.assertInLegacyMode(); mHeadsUpAnimatingAway = headsUpAnimatingAway; mNotificationStackScrollLayoutController.setHeadsUpAnimatingAway(headsUpAnimatingAway); updateVisibility(); Loading @@ -3071,13 +3095,16 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump } private boolean shouldPanelBeVisible() { boolean headsUpVisible = mHeadsUpAnimatingAway || mHeadsUpPinnedMode; boolean headsUpVisible = NotificationsHeadsUpRefactor.isEnabled() ? mHeadsUpVisible : (mHeadsUpAnimatingAway || mHeadsUpPinnedMode); return headsUpVisible || isExpanded() || mBouncerShowing; } private void setHeadsUpManager(HeadsUpManager headsUpManager) { mHeadsUpManager = headsUpManager; if (!NotificationsHeadsUpRefactor.isEnabled()) { mHeadsUpManager.addListener(mOnHeadsUpChangedListener); } mHeadsUpTouchHelper = new HeadsUpTouchHelper( headsUpManager, mStatusBarService, Loading Loading @@ -3165,8 +3192,9 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump } private boolean isPanelVisibleBecauseOfHeadsUp() { return (mHeadsUpManager.hasPinnedHeadsUp() || mHeadsUpAnimatingAway) && mBarState == StatusBarState.SHADE; boolean headsUpVisible = NotificationsHeadsUpRefactor.isEnabled() ? mHeadsUpVisible : (mHeadsUpManager.hasPinnedHeadsUp() || mHeadsUpAnimatingAway); return headsUpVisible && mBarState == StatusBarState.SHADE; } private boolean isPanelVisibleBecauseScrimIsAnimatingOff() { Loading Loading @@ -3479,6 +3507,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump ipw.print("mExpandingFromHeadsUp="); ipw.println(mExpandingFromHeadsUp); ipw.print("mCollapsedOnDown="); ipw.println(mCollapsedOnDown); ipw.print("mClosingWithAlphaFadeOut="); ipw.println(mClosingWithAlphaFadeOut); ipw.print("mHeadsUpVisible="); ipw.println(mHeadsUpVisible); ipw.print("mHeadsUpAnimatingAway="); ipw.println(mHeadsUpAnimatingAway); ipw.print("mShowIconsWhenExpanded="); ipw.println(mShowIconsWhenExpanded); ipw.print("mIndicationBottomPadding="); ipw.println(mIndicationBottomPadding); Loading Loading @@ -4384,6 +4413,8 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump private final class ShadeHeadsUpChangedListener implements OnHeadsUpChangedListener { @Override public void onHeadsUpPinnedModeChanged(final boolean inPinnedMode) { NotificationsHeadsUpRefactor.assertInLegacyMode(); if (inPinnedMode) { mHeadsUpExistenceChangedRunnable.run(); updateNotificationTranslucency(); Loading @@ -4400,9 +4431,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump @Override public void onHeadsUpPinned(NotificationEntry entry) { if (NotificationsHeadsUpRefactor.isEnabled()) { return; } NotificationsHeadsUpRefactor.assertInLegacyMode(); if (!isKeyguardShowing()) { mNotificationStackScrollLayoutController.generateHeadsUpAnimation(entry, true); Loading @@ -4411,9 +4440,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump @Override public void onHeadsUpUnPinned(NotificationEntry entry) { if (NotificationsHeadsUpRefactor.isEnabled()) { return; } NotificationsHeadsUpRefactor.assertInLegacyMode(); // When we're unpinning the notification via active edge they remain heads-upped, // we need to make sure that an animation happens in this case, otherwise the Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/data/repository/HeadsUpRepository.kt +4 −1 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.statusbar.notification.data.repository import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.StateFlow /** * A repository of currently displayed heads up notifications. Loading @@ -31,11 +32,13 @@ interface HeadsUpRepository { * True if we are exiting the headsUp pinned mode, and some notifications might still be * animating out. This is used to keep their view container visible. */ val isHeadsUpAnimatingAway: Flow<Boolean> val isHeadsUpAnimatingAway: StateFlow<Boolean> /** The heads up row that should be displayed on top. */ val topHeadsUpRow: Flow<HeadsUpRowRepository?> /** Set of currently active top-level heads up rows to be displayed. */ val activeHeadsUpRows: Flow<Set<HeadsUpRowRepository>> fun setHeadsUpAnimatingAway(animatingAway: Boolean) }
packages/SystemUI/src/com/android/systemui/statusbar/notification/domain/interactor/HeadsUpNotificationInteractor.kt +4 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ import kotlinx.coroutines.flow.flatMapLatest import kotlinx.coroutines.flow.flowOf import kotlinx.coroutines.flow.map class HeadsUpNotificationInteractor @Inject constructor(repository: HeadsUpRepository) { class HeadsUpNotificationInteractor @Inject constructor(private val repository: HeadsUpRepository) { val topHeadsUpRow: Flow<HeadsUpRowKey?> = repository.topHeadsUpRow Loading Loading @@ -67,6 +67,9 @@ class HeadsUpNotificationInteractor @Inject constructor(repository: HeadsUpRepos fun headsUpRow(key: HeadsUpRowKey): HeadsUpRowInteractor = HeadsUpRowInteractor(key as HeadsUpRowRepository) fun elementKeyFor(key: HeadsUpRowKey) = (key as HeadsUpRowRepository).elementKey fun setHeadsUpAnimatingAway(animatingAway: Boolean) { repository.setHeadsUpAnimatingAway(animatingAway) } } class HeadsUpRowInteractor(repository: HeadsUpRowRepository)
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +37 −3 Original line number Diff line number Diff line Loading @@ -111,6 +111,7 @@ import com.android.systemui.statusbar.notification.row.ActivatableNotificationVi import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; import com.android.systemui.statusbar.notification.row.ExpandableView; import com.android.systemui.statusbar.notification.row.StackScrollerDecorView; import com.android.systemui.statusbar.notification.shared.NotificationsHeadsUpRefactor; import com.android.systemui.statusbar.notification.shared.NotificationsImprovedHunAnimation; import com.android.systemui.statusbar.notification.shared.NotificationsLiveDataStoreRefactor; import com.android.systemui.statusbar.notification.stack.shared.model.ShadeScrimBounds; Loading Loading @@ -450,7 +451,9 @@ public class NotificationStackScrollLayout private boolean mIsClipped; private Rect mRequestedClipBounds; private boolean mInHeadsUpPinnedMode; private boolean mHeadsUpAnimatingAway; @VisibleForTesting boolean mHeadsUpAnimatingAway; private Consumer<Boolean> mHeadsUpAnimatingAwayListener; private int mStatusBarState; private int mUpcomingStatusBarState; private boolean mHeadsUpGoingAwayAnimationsAllowed = true; Loading Loading @@ -4084,7 +4087,14 @@ public class NotificationStackScrollLayout mSwipeHelper.setIsExpanded(isExpanded); if (changed) { mWillExpand = false; if (!mIsExpanded) { if (mIsExpanded) { // Resetting headsUpAnimatingAway on Shade expansion avoids delays caused by // waiting for all child animations to finish. // TODO(b/328390331) Do we need to reset this on QS expanded as well? if (NotificationsHeadsUpRefactor.isEnabled()) { setHeadsUpAnimatingAway(false); } } else { mGroupExpansionManager.collapseGroups(); mExpandHelper.cancelImmediately(); if (!mIsExpansionChanging) { Loading Loading @@ -4190,6 +4200,9 @@ public class NotificationStackScrollLayout void onChildAnimationFinished() { setAnimationRunning(false); if (NotificationsHeadsUpRefactor.isEnabled()) { setHeadsUpAnimatingAway(false); } requestChildrenUpdate(); runAnimationFinishedRunnables(); clearTransient(); Loading Loading @@ -4717,6 +4730,7 @@ public class NotificationStackScrollLayout } public void generateHeadsUpAnimation(NotificationEntry entry, boolean isHeadsUp) { NotificationsHeadsUpRefactor.assertInLegacyMode(); ExpandableNotificationRow row = entry.getHeadsUpAnimationView(); generateHeadsUpAnimation(row, isHeadsUp); } Loading Loading @@ -4750,6 +4764,9 @@ public class NotificationStackScrollLayout mNeedsAnimation = true; if (!mIsExpanded && !mWillExpand && !isHeadsUp) { row.setHeadsUpAnimatingAway(true); if (NotificationsHeadsUpRefactor.isEnabled()) { setHeadsUpAnimatingAway(true); } } requestChildrenUpdate(); } Loading Loading @@ -4939,11 +4956,28 @@ public class NotificationStackScrollLayout updateClipping(); } /** TODO(b/328390331) make this private, when {@link NotificationsHeadsUpRefactor} is removed */ public void setHeadsUpAnimatingAway(boolean headsUpAnimatingAway) { if (mHeadsUpAnimatingAway != headsUpAnimatingAway) { mHeadsUpAnimatingAway = headsUpAnimatingAway; if (mHeadsUpAnimatingAwayListener != null) { mHeadsUpAnimatingAwayListener.accept(headsUpAnimatingAway); } } updateClipping(); } /** * Sets a listener to be notified about the heads up disappear animation state changes. If there * are overlapping animations, it will receive updates when the first disappar animation has * started, and when the last has finished. * * @param headsUpAnimatingAwayListener to be notified about disappear animation state changes. */ public void setHeadsUpAnimatingAwayListener( Consumer<Boolean> headsUpAnimatingAwayListener) { mHeadsUpAnimatingAwayListener = headsUpAnimatingAwayListener; } @VisibleForTesting public void setStatusBarState(int statusBarState) { mStatusBarState = statusBarState; Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java +1 −0 Original line number Diff line number Diff line Loading @@ -1482,6 +1482,7 @@ public class NotificationStackScrollLayoutController implements Dumpable { } public void setHeadsUpAnimatingAway(boolean headsUpAnimatingAway) { NotificationsHeadsUpRefactor.assertInLegacyMode(); mView.setHeadsUpAnimatingAway(headsUpAnimatingAway); } Loading