Loading packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/GoneScene.kt +10 −5 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ import com.android.systemui.notifications.ui.composable.SnoozeableHeadsUpNotific import com.android.systemui.qs.ui.composable.QuickSettings import com.android.systemui.qs.ui.composable.QuickSettings.SharedValues.MediaLandscapeTopOffset import com.android.systemui.qs.ui.composable.QuickSettings.SharedValues.MediaOffset.Default import com.android.systemui.scene.shared.model.Overlays import com.android.systemui.scene.shared.model.Scenes import com.android.systemui.scene.ui.viewmodel.GoneUserActionsViewModel import com.android.systemui.statusbar.notification.stack.ui.view.NotificationScrollView Loading Loading @@ -70,18 +71,22 @@ constructor( @Composable override fun SceneScope.Content(modifier: Modifier) { val isIdle by remember { derivedStateOf { layoutState.transitionState is TransitionState.Idle } val isIdleAndNotOccluded by remember { derivedStateOf { layoutState.transitionState is TransitionState.Idle && Overlays.NotificationsShade !in layoutState.transitionState.currentOverlays } } LaunchedEffect(isIdle) { LaunchedEffect(isIdleAndNotOccluded) { // Wait for being Idle on this Scene, otherwise LaunchedEffect would fire too soon, // and another transition could override the NSSL stack bounds. if (isIdle) { if (isIdleAndNotOccluded) { // Reset the stack bounds to avoid caching these values from the previous Scenes, // and not to confuse the StackScrollAlgorithm when it displays a HUN over GONE. notificationStackScrolLView.get().apply { setStackTop(0f) // use -headsUpInset to allow HUN translation outside bounds for snoozing setStackTop(-getHeadsUpInset().toFloat()) setStackCutoff(0f) } } Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewbinder/NotificationScrollViewBinder.kt +0 −5 Original line number Diff line number Diff line Loading @@ -108,11 +108,6 @@ constructor( view.setPulsing(isPulsing, viewModel.shouldAnimatePulse.value) } } launch { viewModel.shouldResetStackTop .filter { it } .collectTraced { view.setStackTop(-(view.getHeadsUpInset().toFloat())) } } launch { viewModel.shouldCloseGuts .filter { it } Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationScrollViewModel.kt +0 −6 Original line number Diff line number Diff line Loading @@ -192,12 +192,6 @@ constructor( /** Whether we should close any open notification guts. */ val shouldCloseGuts: Flow<Boolean> = stackAppearanceInteractor.shouldCloseGuts val shouldResetStackTop: Flow<Boolean> = sceneInteractor.transitionState .mapNotNull { state -> state is Idle && state.currentScene == Scenes.Gone } .distinctUntilChanged() .dumpWhileCollecting("shouldResetStackTop") /** Whether the Notification Stack is visibly on the lockscreen scene. */ val isShowingStackOnLockscreen: Flow<Boolean> = sceneInteractor.transitionState Loading Loading
packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/GoneScene.kt +10 −5 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ import com.android.systemui.notifications.ui.composable.SnoozeableHeadsUpNotific import com.android.systemui.qs.ui.composable.QuickSettings import com.android.systemui.qs.ui.composable.QuickSettings.SharedValues.MediaLandscapeTopOffset import com.android.systemui.qs.ui.composable.QuickSettings.SharedValues.MediaOffset.Default import com.android.systemui.scene.shared.model.Overlays import com.android.systemui.scene.shared.model.Scenes import com.android.systemui.scene.ui.viewmodel.GoneUserActionsViewModel import com.android.systemui.statusbar.notification.stack.ui.view.NotificationScrollView Loading Loading @@ -70,18 +71,22 @@ constructor( @Composable override fun SceneScope.Content(modifier: Modifier) { val isIdle by remember { derivedStateOf { layoutState.transitionState is TransitionState.Idle } val isIdleAndNotOccluded by remember { derivedStateOf { layoutState.transitionState is TransitionState.Idle && Overlays.NotificationsShade !in layoutState.transitionState.currentOverlays } } LaunchedEffect(isIdle) { LaunchedEffect(isIdleAndNotOccluded) { // Wait for being Idle on this Scene, otherwise LaunchedEffect would fire too soon, // and another transition could override the NSSL stack bounds. if (isIdle) { if (isIdleAndNotOccluded) { // Reset the stack bounds to avoid caching these values from the previous Scenes, // and not to confuse the StackScrollAlgorithm when it displays a HUN over GONE. notificationStackScrolLView.get().apply { setStackTop(0f) // use -headsUpInset to allow HUN translation outside bounds for snoozing setStackTop(-getHeadsUpInset().toFloat()) setStackCutoff(0f) } } Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewbinder/NotificationScrollViewBinder.kt +0 −5 Original line number Diff line number Diff line Loading @@ -108,11 +108,6 @@ constructor( view.setPulsing(isPulsing, viewModel.shouldAnimatePulse.value) } } launch { viewModel.shouldResetStackTop .filter { it } .collectTraced { view.setStackTop(-(view.getHeadsUpInset().toFloat())) } } launch { viewModel.shouldCloseGuts .filter { it } Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationScrollViewModel.kt +0 −6 Original line number Diff line number Diff line Loading @@ -192,12 +192,6 @@ constructor( /** Whether we should close any open notification guts. */ val shouldCloseGuts: Flow<Boolean> = stackAppearanceInteractor.shouldCloseGuts val shouldResetStackTop: Flow<Boolean> = sceneInteractor.transitionState .mapNotNull { state -> state is Idle && state.currentScene == Scenes.Gone } .distinctUntilChanged() .dumpWhileCollecting("shouldResetStackTop") /** Whether the Notification Stack is visibly on the lockscreen scene. */ val isShowingStackOnLockscreen: Flow<Boolean> = sceneInteractor.transitionState Loading