Merge "[flexiglass] Fixes clock and smartspace jitter in AOD" into main
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/modifier/BurnInModifiers.kt b/packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/modifier/BurnInModifiers.kt
index 9444664..71230f9 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/modifier/BurnInModifiers.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/modifier/BurnInModifiers.kt
@@ -17,8 +17,9 @@
package com.android.systemui.keyguard.ui.composable.modifier
import androidx.compose.runtime.Composable
+import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
-import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.mutableFloatStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.graphicsLayer
@@ -41,15 +42,17 @@
params: BurnInParameters,
isClock: Boolean = false,
): Modifier {
- val translationYState = remember { mutableStateOf(0F) }
- viewModel.updateBurnInParams(params.copy(translationY = { translationYState.value }))
+ val cachedYTranslation = remember { mutableFloatStateOf(0f) }
+ LaunchedEffect(Unit) {
+ viewModel.updateBurnInParams(params.copy(translationY = { cachedYTranslation.floatValue }))
+ }
val burnIn = viewModel.movement
val translationX by
burnIn.map { it.translationX.toFloat() }.collectAsStateWithLifecycle(initialValue = 0f)
val translationY by
burnIn.map { it.translationY.toFloat() }.collectAsStateWithLifecycle(initialValue = 0f)
- translationYState.value = translationY
+ cachedYTranslation.floatValue = translationY
val scaleViewModel by
burnIn
.map { BurnInScaleViewModel(scale = it.scale, scaleClockOnly = it.scaleClockOnly) }