Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModel.kt +3 −3 Original line number Diff line number Diff line Loading @@ -240,13 +240,13 @@ constructor( */ val translationY: Flow<Float> = combine( isOnLockscreen, isOnLockscreenWithoutShade, merge( keyguardInteractor.keyguardTranslationY, occludedToLockscreenTransitionViewModel.lockscreenTranslationY, ) ) { isOnLockscreen, translationY -> if (isOnLockscreen) { ) { isOnLockscreenWithoutShade, translationY -> if (isOnLockscreenWithoutShade) { translationY } else { 0f Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModelTest.kt +40 −0 Original line number Diff line number Diff line Loading @@ -483,6 +483,46 @@ class SharedNotificationContainerViewModelTest : SysuiTestCase() { assertThat(maxNotifications).isEqualTo(-1) } @Test fun translationYUpdatesOnKeyguard() = testScope.runTest { val translationY by collectLastValue(underTest.translationY) configurationRepository.setDimensionPixelSize( R.dimen.keyguard_translate_distance_on_swipe_up, -100 ) configurationRepository.onAnyConfigurationChange() // legacy expansion means the user is swiping up, usually for the bouncer shadeRepository.setLegacyShadeExpansion(0.5f) showLockscreen() // The translation values are negative assertThat(translationY).isLessThan(0f) } @Test fun translationYDoesNotUpdateWhenShadeIsExpanded() = testScope.runTest { val translationY by collectLastValue(underTest.translationY) configurationRepository.setDimensionPixelSize( R.dimen.keyguard_translate_distance_on_swipe_up, -100 ) configurationRepository.onAnyConfigurationChange() // legacy expansion means the user is swiping up, usually for the bouncer but also for // shade collapsing shadeRepository.setLegacyShadeExpansion(0.5f) showLockscreenWithShadeExpanded() assertThat(translationY).isEqualTo(0f) } @Test fun updateBounds_fromKeyguardRoot() = testScope.runTest { Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModel.kt +3 −3 Original line number Diff line number Diff line Loading @@ -240,13 +240,13 @@ constructor( */ val translationY: Flow<Float> = combine( isOnLockscreen, isOnLockscreenWithoutShade, merge( keyguardInteractor.keyguardTranslationY, occludedToLockscreenTransitionViewModel.lockscreenTranslationY, ) ) { isOnLockscreen, translationY -> if (isOnLockscreen) { ) { isOnLockscreenWithoutShade, translationY -> if (isOnLockscreenWithoutShade) { translationY } else { 0f Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModelTest.kt +40 −0 Original line number Diff line number Diff line Loading @@ -483,6 +483,46 @@ class SharedNotificationContainerViewModelTest : SysuiTestCase() { assertThat(maxNotifications).isEqualTo(-1) } @Test fun translationYUpdatesOnKeyguard() = testScope.runTest { val translationY by collectLastValue(underTest.translationY) configurationRepository.setDimensionPixelSize( R.dimen.keyguard_translate_distance_on_swipe_up, -100 ) configurationRepository.onAnyConfigurationChange() // legacy expansion means the user is swiping up, usually for the bouncer shadeRepository.setLegacyShadeExpansion(0.5f) showLockscreen() // The translation values are negative assertThat(translationY).isLessThan(0f) } @Test fun translationYDoesNotUpdateWhenShadeIsExpanded() = testScope.runTest { val translationY by collectLastValue(underTest.translationY) configurationRepository.setDimensionPixelSize( R.dimen.keyguard_translate_distance_on_swipe_up, -100 ) configurationRepository.onAnyConfigurationChange() // legacy expansion means the user is swiping up, usually for the bouncer but also for // shade collapsing shadeRepository.setLegacyShadeExpansion(0.5f) showLockscreenWithShadeExpanded() assertThat(translationY).isEqualTo(0f) } @Test fun updateBounds_fromKeyguardRoot() = testScope.runTest { Loading