Created
February 22, 2023 19:24
-
-
Save Kpeved/6e967e4187c0da27cc9aeec4f9a5bb65 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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