Loading packages/SystemUI/src/com/android/systemui/inputdevice/tutorial/ui/composable/TutorialAnimation.kt +11 −2 Original line number Diff line number Diff line Loading @@ -23,13 +23,16 @@ import androidx.compose.animation.core.LinearEasing import androidx.compose.animation.core.tween import androidx.compose.animation.fadeOut import androidx.compose.animation.togetherWith import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.node.Ref Loading Loading @@ -93,13 +96,19 @@ private fun EducationAnimation( animationProperties: LottieDynamicProperties, ) { val composition by rememberLottieComposition(LottieCompositionSpec.RawRes(educationAnimationId)) var isPlaying by remember { mutableStateOf(true) } val progress by animateLottieCompositionAsState(composition, iterations = LottieConstants.IterateForever) animateLottieCompositionAsState( composition, iterations = LottieConstants.IterateForever, isPlaying = isPlaying, restartOnPlay = false, ) LottieAnimation( composition = composition, progress = { progress }, dynamicProperties = animationProperties, modifier = Modifier.fillMaxSize(), modifier = Modifier.fillMaxSize().clickable { isPlaying = !isPlaying }, ) } Loading Loading
packages/SystemUI/src/com/android/systemui/inputdevice/tutorial/ui/composable/TutorialAnimation.kt +11 −2 Original line number Diff line number Diff line Loading @@ -23,13 +23,16 @@ import androidx.compose.animation.core.LinearEasing import androidx.compose.animation.core.tween import androidx.compose.animation.fadeOut import androidx.compose.animation.togetherWith import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.node.Ref Loading Loading @@ -93,13 +96,19 @@ private fun EducationAnimation( animationProperties: LottieDynamicProperties, ) { val composition by rememberLottieComposition(LottieCompositionSpec.RawRes(educationAnimationId)) var isPlaying by remember { mutableStateOf(true) } val progress by animateLottieCompositionAsState(composition, iterations = LottieConstants.IterateForever) animateLottieCompositionAsState( composition, iterations = LottieConstants.IterateForever, isPlaying = isPlaying, restartOnPlay = false, ) LottieAnimation( composition = composition, progress = { progress }, dynamicProperties = animationProperties, modifier = Modifier.fillMaxSize(), modifier = Modifier.fillMaxSize().clickable { isPlaying = !isPlaying }, ) } Loading