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

Commit c2f681cd authored by Matt Pietal's avatar Matt Pietal
Browse files

DOZING->LOCKSCREEN alpha should just be 1f

This avoids what looks like a flicker with the wallpaper
as content comes in

Fixes: 357781845
Test: DozingToLockscreenTransitionViewModelTest
Flag: com.android.systemui.migrate_clocks_to_blueprint
Change-Id: I56900144639415dd8bd17de9231c14faae994cf4
parent a14bbb53
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)