Skip to content

Instantly share code, notes, and snippets.

@Kpeved
Created February 22, 2023 19:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kpeved/6e967e4187c0da27cc9aeec4f9a5bb65 to your computer and use it in GitHub Desktop.
Save Kpeved/6e967e4187c0da27cc9aeec4f9a5bb65 to your computer and use it in GitHub Desktop.
@Composable
fun ClockAnimation(duration: Int) {
val infiniteTransition = rememberInfiniteTransition()
// Creates a child animation of float type as a part of the [InfiniteTransition].
val clockAnimation by infiniteTransition.animateFloat(
initialValue = 0f,
targetValue = 720f,
animationSpec = infiniteRepeatable(
animation = tween(duration, easing = LinearEasing),
repeatMode = RepeatMode.Restart
)
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment