Loading packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/viewmodel/DozingToLockscreenTransitionViewModelTest.kt +22 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,28 @@ class DozingToLockscreenTransitionViewModelTest : SysuiTestCase() { val repository = kosmos.fakeKeyguardTransitionRepository val underTest = kosmos.dozingToLockscreenTransitionViewModel @Test fun lockscreenAlpha() = testScope.runTest { val lockscreenAlpha by collectValues(underTest.lockscreenAlpha) repository.sendTransitionStep(step(0f, TransitionState.STARTED)) repository.sendTransitionStep(step(0.1f)) repository.sendTransitionStep(step(0.5f)) repository.sendTransitionStep(step(1f)) lockscreenAlpha.forEach { assertThat(it).isEqualTo(1f) } } @Test fun shortcutsAlpha() = testScope.runTest { val shortcutsAlpha by collectValues(underTest.shortcutsAlpha) repository.sendTransitionStep(step(0f, TransitionState.STARTED)) repository.sendTransitionStep(step(0.5f)) repository.sendTransitionStep(step(1f)) assertThat(shortcutsAlpha[0]).isEqualTo(0f) assertThat(shortcutsAlpha[1]).isEqualTo(1f) } @Test fun deviceEntryParentViewShows() = testScope.runTest { Loading packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/DozingToLockscreenTransitionViewModel.kt +2 −1 Original line number Diff line number Diff line Loading @@ -51,7 +51,8 @@ constructor( onCancel = { 0f }, ) val lockscreenAlpha: Flow<Float> = shortcutsAlpha // Show immediately to avoid what can appear to be a flicker on device wakeup val lockscreenAlpha: Flow<Float> = transitionAnimation.immediatelyTransitionTo(1f) val deviceEntryBackgroundViewAlpha: Flow<Float> = transitionAnimation.immediatelyTransitionTo(1f) Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/viewmodel/DozingToLockscreenTransitionViewModelTest.kt +22 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,28 @@ class DozingToLockscreenTransitionViewModelTest : SysuiTestCase() { val repository = kosmos.fakeKeyguardTransitionRepository val underTest = kosmos.dozingToLockscreenTransitionViewModel @Test fun lockscreenAlpha() = testScope.runTest { val lockscreenAlpha by collectValues(underTest.lockscreenAlpha) repository.sendTransitionStep(step(0f, TransitionState.STARTED)) repository.sendTransitionStep(step(0.1f)) repository.sendTransitionStep(step(0.5f)) repository.sendTransitionStep(step(1f)) lockscreenAlpha.forEach { assertThat(it).isEqualTo(1f) } } @Test fun shortcutsAlpha() = testScope.runTest { val shortcutsAlpha by collectValues(underTest.shortcutsAlpha) repository.sendTransitionStep(step(0f, TransitionState.STARTED)) repository.sendTransitionStep(step(0.5f)) repository.sendTransitionStep(step(1f)) assertThat(shortcutsAlpha[0]).isEqualTo(0f) assertThat(shortcutsAlpha[1]).isEqualTo(1f) } @Test fun deviceEntryParentViewShows() = testScope.runTest { Loading
packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/DozingToLockscreenTransitionViewModel.kt +2 −1 Original line number Diff line number Diff line Loading @@ -51,7 +51,8 @@ constructor( onCancel = { 0f }, ) val lockscreenAlpha: Flow<Float> = shortcutsAlpha // Show immediately to avoid what can appear to be a flicker on device wakeup val lockscreenAlpha: Flow<Float> = transitionAnimation.immediatelyTransitionTo(1f) val deviceEntryBackgroundViewAlpha: Flow<Float> = transitionAnimation.immediatelyTransitionTo(1f) Loading