summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2024-04-17 06:42:41 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2024-04-17 06:42:41 +0000
commit748f05324ae4feb26938dd21c694bda86378d84e (patch)
tree532c65a297739a84d4645e361ae5438a183c458b
parent623e793669724a83b8547de15e57b20685493bcc (diff)
parentfda490111363ab5e1acba5086ab83ab0f86f0f45 (diff)
Merge "Fix smallClock and smartspace jumping when transitioning from AOD to Lockscreen" into main
-rw-r--r--packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/modifier/BurnInModifiers.kt7
1 files changed, 6 insertions, 1 deletions
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 2a99039fa306..238a230ff013 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
@@ -19,6 +19,8 @@ package com.android.systemui.keyguard.ui.composable.modifier
import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.layout.boundsInWindow
@@ -39,9 +41,12 @@ fun Modifier.burnInAware(
params: BurnInParameters,
isClock: Boolean = false,
): Modifier {
- val burnIn = viewModel.movement(params)
+ val translationYState = remember { mutableStateOf(0F) }
+ val copiedParams = params.copy(translationY = { translationYState.value })
+ val burnIn = viewModel.movement(copiedParams)
val translationX by burnIn.map { it.translationX.toFloat() }.collectAsState(initial = 0f)
val translationY by burnIn.map { it.translationY.toFloat() }.collectAsState(initial = 0f)
+ translationYState.value = translationY
val scaleViewModel by
burnIn
.map {