Created
March 12, 2023 21:57
-
-
Save Kpeved/3f47e605aebfe471950c608444e57160 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
... | |
Column( | |
verticalArrangement = Arrangement.Center, | |
horizontalAlignment = Alignment.CenterHorizontally | |
) { | |
val size = 300.dp | |
var progress by remember { mutableStateOf(0f) } | |
var animationAngle by remember { mutableStateOf(0f) } | |
Box( | |
modifier = Modifier | |
.size(size) | |
.background(Color.Black) | |
) { | |
ClockAnimation(animationAngle) | |
} | |
Text("Control animation with a slider!") | |
Slider( | |
modifier = Modifier.padding(16.dp), | |
value = progress, | |
onValueChange = { | |
progress = it | |
animationAngle = it * 720f | |
} | |
) | |
} ... | |
} | |
@Composable | |
fun ClockAnimation(animationAngle: Float) { | |
… |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment