Loading packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/NotificationStackAppearanceIntegrationTest.kt +16 −0 Original line number Diff line number Diff line Loading @@ -172,6 +172,22 @@ class NotificationStackAppearanceIntegrationTest : SysuiTestCase() { assertThat(isScrollable).isTrue() } @Test fun shadeExpansion_idleOnQs() = testScope.runTest { val transitionState = MutableStateFlow<ObservableTransitionState>( ObservableTransitionState.Idle(currentScene = Scenes.QuickSettings) ) sceneInteractor.setTransitionState(transitionState) val expandFraction by collectLastValue(scrollViewModel.expandFraction) assertThat(expandFraction).isEqualTo(1f) fakeSceneDataSource.changeScene(toScene = Scenes.QuickSettings) val isScrollable by collectLastValue(scrollViewModel.isScrollable) assertThat(isScrollable).isFalse() } @Test fun shadeExpansion_shadeToQs() = testScope.runTest { Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationScrollViewModel.kt +11 −7 Original line number Diff line number Diff line Loading @@ -70,10 +70,10 @@ constructor( ) { shadeExpansion, shadeMode, qsExpansion, transitionState, quickSettingsScene -> when (transitionState) { is ObservableTransitionState.Idle -> { if (transitionState.currentScene == Scenes.Lockscreen) { 1f } else { shadeExpansion when (transitionState.currentScene) { Scenes.Lockscreen, Scenes.QuickSettings -> 1f else -> shadeExpansion } } is ObservableTransitionState.Transition -> { Loading Loading @@ -162,9 +162,13 @@ constructor( stackAppearanceInteractor::setCurrentGestureOverscroll /** Whether the notification stack is scrollable or not. */ val isScrollable: Flow<Boolean> = sceneInteractor.currentScene.map { sceneInteractor.isSceneInFamily(it, SceneFamilies.NotifShade) || it == Scenes.Lockscreen }.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 +16 −0 Original line number Diff line number Diff line Loading @@ -172,6 +172,22 @@ class NotificationStackAppearanceIntegrationTest : SysuiTestCase() { assertThat(isScrollable).isTrue() } @Test fun shadeExpansion_idleOnQs() = testScope.runTest { val transitionState = MutableStateFlow<ObservableTransitionState>( ObservableTransitionState.Idle(currentScene = Scenes.QuickSettings) ) sceneInteractor.setTransitionState(transitionState) val expandFraction by collectLastValue(scrollViewModel.expandFraction) assertThat(expandFraction).isEqualTo(1f) fakeSceneDataSource.changeScene(toScene = Scenes.QuickSettings) val isScrollable by collectLastValue(scrollViewModel.isScrollable) assertThat(isScrollable).isFalse() } @Test fun shadeExpansion_shadeToQs() = testScope.runTest { Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationScrollViewModel.kt +11 −7 Original line number Diff line number Diff line Loading @@ -70,10 +70,10 @@ constructor( ) { shadeExpansion, shadeMode, qsExpansion, transitionState, quickSettingsScene -> when (transitionState) { is ObservableTransitionState.Idle -> { if (transitionState.currentScene == Scenes.Lockscreen) { 1f } else { shadeExpansion when (transitionState.currentScene) { Scenes.Lockscreen, Scenes.QuickSettings -> 1f else -> shadeExpansion } } is ObservableTransitionState.Transition -> { Loading Loading @@ -162,9 +162,13 @@ constructor( stackAppearanceInteractor::setCurrentGestureOverscroll /** Whether the notification stack is scrollable or not. */ val isScrollable: Flow<Boolean> = sceneInteractor.currentScene.map { sceneInteractor.isSceneInFamily(it, SceneFamilies.NotifShade) || it == Scenes.Lockscreen }.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