Tomas Gordian
12/07/2021, 12:41 PM@Composable
fun MainScreen() {
var animation by remember { mutableStateOf(AnimationWrapper()) }
Column {
Card(animation = animation)
Button(onClick = {
animation = AnimationWrapper(400, 8)
}) {
Text(text = "Button")
}
}
}
@Composable
fun Card(animation: AnimationWrapper) {
// make some animations based on animation wrapper
}
data class AnimationWrapper(val duration: Int = 0, val rotation: Int = 0)