summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Matt Pietal <mpietal@google.com> 2024-08-09 15:12:09 +0000
committer Matt Pietal <mpietal@google.com> 2024-08-12 14:05:54 +0000
commitc2f681cdc41dcc4adbd39effbfaf95d82b5e14cc (patch)
tree60548a1110d7e776cf824743d22de39209f2a447
parenta14bbb53fb85f4b5b6d55a998bd9f16d27962222 (diff)
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
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/viewmodel/DozingToLockscreenTransitionViewModelTest.kt22
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/DozingToLockscreenTransitionViewModel.kt3
2 files changed, 24 insertions, 1 deletions
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/viewmodel/DozingToLockscreenTransitionViewModelTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/viewmodel/DozingToLockscreenTransitionViewModelTest.kt
index 4a10d80430e9..8e4876d3c6df 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/viewmodel/DozingToLockscreenTransitionViewModelTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/viewmodel/DozingToLockscreenTransitionViewModelTest.kt
@@ -42,6 +42,28 @@ class DozingToLockscreenTransitionViewModelTest : SysuiTestCase() {
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 {
val deviceEntryParentViewAlpha by collectValues(underTest.deviceEntryParentViewAlpha)
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/DozingToLockscreenTransitionViewModel.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/DozingToLockscreenTransitionViewModel.kt
index a460d515e0b2..9d8a7a81b9dc 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/DozingToLockscreenTransitionViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/DozingToLockscreenTransitionViewModel.kt
@@ -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)