Loading packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/NotificationStackAppearanceIntegrationTest.kt +6 −1 Original line number Diff line number Diff line Loading @@ -121,10 +121,13 @@ class NotificationStackAppearanceIntegrationTest : SysuiTestCase() { sceneInteractor.setTransitionState(transitionState) val expandFraction by collectLastValue(scrollViewModel.expandFraction) assertThat(expandFraction).isEqualTo(0f) fakeSceneDataSource.changeScene(toScene = Scenes.Gone) val isScrollable by collectLastValue(scrollViewModel.isScrollable) assertThat(isScrollable).isFalse() fakeSceneDataSource.pause() sceneInteractor.changeScene(Scenes.Shade, "reason") val transitionProgress = MutableStateFlow(0f) transitionState.value = Loading Loading @@ -159,8 +162,10 @@ class NotificationStackAppearanceIntegrationTest : SysuiTestCase() { sceneInteractor.setTransitionState(transitionState) val expandFraction by collectLastValue(scrollViewModel.expandFraction) assertThat(expandFraction).isEqualTo(1f) fakeSceneDataSource.changeScene(toScene = Scenes.Lockscreen) val isScrollable by collectLastValue(scrollViewModel.isScrollable) assertThat(isScrollable).isFalse() assertThat(isScrollable).isTrue() } @Test Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +1 −1 Original line number Diff line number Diff line Loading @@ -3721,7 +3721,7 @@ public class NotificationStackScrollLayout protected boolean isInsideQsHeader(MotionEvent ev) { if (SceneContainerFlag.isEnabled()) { return ev.getY() < mScrollViewFields.getScrimClippingShape().getBounds().getTop(); return ev.getY() < mScrollViewFields.getStackTop(); } mQsHeader.getBoundsOnScreen(mQsHeaderBound); Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationScrollViewModel.kt +5 −4 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.flow.flowOf import kotlinx.coroutines.flow.map /** ViewModel which represents the state of the NSSL/Controller in the world of flexiglass */ @SysUISingleton Loading Loading @@ -146,6 +147,7 @@ constructor( /** Receives the amount (px) that the stack should scroll due to internal expansion. */ val syntheticScrollConsumer: (Float) -> Unit = stackAppearanceInteractor::setSyntheticScroll /** * Receives whether the current touch gesture is overscroll as it has already been consumed by * the stack. Loading @@ -154,10 +156,9 @@ constructor( stackAppearanceInteractor::setCurrentGestureOverscroll /** Whether the notification stack is scrollable or not. */ val isScrollable: Flow<Boolean> = sceneInteractor .isCurrentSceneInFamily(SceneFamilies.NotifShade) .dumpWhileCollecting("isScrollable") val isScrollable: Flow<Boolean> = sceneInteractor.currentScene.map { sceneInteractor.isSceneInFamily(it, SceneFamilies.NotifShade) || it == Scenes.Lockscreen }.dumpWhileCollecting("isScrollable") /** Whether the notification stack is displayed in doze mode. */ val isDozing: Flow<Boolean> by lazy { Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/NotificationStackAppearanceIntegrationTest.kt +6 −1 Original line number Diff line number Diff line Loading @@ -121,10 +121,13 @@ class NotificationStackAppearanceIntegrationTest : SysuiTestCase() { sceneInteractor.setTransitionState(transitionState) val expandFraction by collectLastValue(scrollViewModel.expandFraction) assertThat(expandFraction).isEqualTo(0f) fakeSceneDataSource.changeScene(toScene = Scenes.Gone) val isScrollable by collectLastValue(scrollViewModel.isScrollable) assertThat(isScrollable).isFalse() fakeSceneDataSource.pause() sceneInteractor.changeScene(Scenes.Shade, "reason") val transitionProgress = MutableStateFlow(0f) transitionState.value = Loading Loading @@ -159,8 +162,10 @@ class NotificationStackAppearanceIntegrationTest : SysuiTestCase() { sceneInteractor.setTransitionState(transitionState) val expandFraction by collectLastValue(scrollViewModel.expandFraction) assertThat(expandFraction).isEqualTo(1f) fakeSceneDataSource.changeScene(toScene = Scenes.Lockscreen) val isScrollable by collectLastValue(scrollViewModel.isScrollable) assertThat(isScrollable).isFalse() assertThat(isScrollable).isTrue() } @Test Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +1 −1 Original line number Diff line number Diff line Loading @@ -3721,7 +3721,7 @@ public class NotificationStackScrollLayout protected boolean isInsideQsHeader(MotionEvent ev) { if (SceneContainerFlag.isEnabled()) { return ev.getY() < mScrollViewFields.getScrimClippingShape().getBounds().getTop(); return ev.getY() < mScrollViewFields.getStackTop(); } mQsHeader.getBoundsOnScreen(mQsHeaderBound); Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationScrollViewModel.kt +5 −4 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.flow.flowOf import kotlinx.coroutines.flow.map /** ViewModel which represents the state of the NSSL/Controller in the world of flexiglass */ @SysUISingleton Loading Loading @@ -146,6 +147,7 @@ constructor( /** Receives the amount (px) that the stack should scroll due to internal expansion. */ val syntheticScrollConsumer: (Float) -> Unit = stackAppearanceInteractor::setSyntheticScroll /** * Receives whether the current touch gesture is overscroll as it has already been consumed by * the stack. Loading @@ -154,10 +156,9 @@ constructor( stackAppearanceInteractor::setCurrentGestureOverscroll /** Whether the notification stack is scrollable or not. */ val isScrollable: Flow<Boolean> = sceneInteractor .isCurrentSceneInFamily(SceneFamilies.NotifShade) .dumpWhileCollecting("isScrollable") val isScrollable: Flow<Boolean> = sceneInteractor.currentScene.map { sceneInteractor.isSceneInFamily(it, SceneFamilies.NotifShade) || it == Scenes.Lockscreen }.dumpWhileCollecting("isScrollable") /** Whether the notification stack is displayed in doze mode. */ val isDozing: Flow<Boolean> by lazy { Loading