diff --git a/NavigationCodelab/app/src/main/java/com/example/compose/rally/ui/components/RallyAnimatedCircle.kt b/NavigationCodelab/app/src/main/java/com/example/compose/rally/ui/components/RallyAnimatedCircle.kt index 8c85ca1a5..171e15f80 100644 --- a/NavigationCodelab/app/src/main/java/com/example/compose/rally/ui/components/RallyAnimatedCircle.kt +++ b/NavigationCodelab/app/src/main/java/com/example/compose/rally/ui/components/RallyAnimatedCircle.kt @@ -20,8 +20,8 @@ import androidx.compose.animation.core.CubicBezierEasing import androidx.compose.animation.core.LinearOutSlowInEasing import androidx.compose.animation.core.MutableTransitionState import androidx.compose.animation.core.animateFloat +import androidx.compose.animation.core.rememberTransition import androidx.compose.animation.core.tween -import androidx.compose.animation.core.updateTransition import androidx.compose.foundation.Canvas import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue @@ -50,7 +50,7 @@ fun AnimatedCircle( .apply { targetState = AnimatedCircleProgress.END } } val stroke = with(LocalDensity.current) { Stroke(5.dp.toPx()) } - val transition = updateTransition(currentState) + val transition = rememberTransition(currentState) val angleOffset by transition.animateFloat( transitionSpec = { tween( diff --git a/TestingCodelab/app/src/main/java/com/example/compose/rally/ui/components/AnimatedCircle.kt b/TestingCodelab/app/src/main/java/com/example/compose/rally/ui/components/AnimatedCircle.kt index b35bd778a..a2fb3f9bc 100644 --- a/TestingCodelab/app/src/main/java/com/example/compose/rally/ui/components/AnimatedCircle.kt +++ b/TestingCodelab/app/src/main/java/com/example/compose/rally/ui/components/AnimatedCircle.kt @@ -20,6 +20,7 @@ import androidx.compose.animation.core.CubicBezierEasing import androidx.compose.animation.core.LinearOutSlowInEasing import androidx.compose.animation.core.MutableTransitionState import androidx.compose.animation.core.animateFloat +import androidx.compose.animation.core.rememberTransition import androidx.compose.animation.core.tween import androidx.compose.animation.core.updateTransition import androidx.compose.foundation.Canvas @@ -50,7 +51,7 @@ fun AnimatedCircle( .apply { targetState = AnimatedCircleProgress.END } } val stroke = with(LocalDensity.current) { Stroke(5.dp.toPx()) } - val transition = updateTransition(currentState) + val transition = rememberTransition(currentState) val angleOffset by transition.animateFloat( transitionSpec = { tween(