Skip to content

Commit

Permalink
Update transition API
Browse files Browse the repository at this point in the history
  • Loading branch information
JolandaVerhoef committed Sep 5, 2024
1 parent b0f0f6d commit 7aac258
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 7aac258

Please sign in to comment.