Skip to content

Instantly share code, notes, and snippets.

@abircse
Forked from bharath914/cardanimation.kt
Created May 2, 2024 02:47
Show Gist options
  • Save abircse/cd54a0197372c8116ffb2c0ac681de04 to your computer and use it in GitHub Desktop.
Save abircse/cd54a0197372c8116ffb2c0ac681de04 to your computer and use it in GitHub Desktop.
Quick Card Animation in Jetpack Compose
val animatable = remember {
Animatable(0.5f)
}
LaunchedEffect(key1 = true) {
animatable.animateTo(1f, tween(350, easing = FastOutSlowInEasing))
// you can tweak out and customize these animations.
}
// add this animatable to your card's modifier graphics layer.
BookItem(modifier = cardMod.graphicsLayer {
this.scaleX = animatable.value
this.scaleY = animatable.value
}, entity = item)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment