Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 47c54dc7 authored by Matt Pietal's avatar Matt Pietal Committed by Android (Google) Code Review
Browse files

Merge "DOZING->LOCKSCREEN alpha should just be 1f" into main

parents 5c11f930 c2f681cd
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -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 {
+2 −1
Original line number Diff line number Diff line
@@ -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)