I have a list of languages wihtin Column() composable. I want to apply stacking animation to all composables within Column() composable. I wrote some code for the same and its working partially. It's animating all RadioButtonChip() composables at once. But i want some delay in animation for each RadioButtonChip() composable so it gives stacking animation feel.
val animateOffsetY = remember { Animatable(300f) }
LaunchedEffect(Unit) {
languages.forEachIndexed { index, _ ->
delay(index.toLong() * 200)
animateOffsetY.animateTo(0f, animationSpec = tween(500))
}
}
Column(
modifier = modifier.fillMaxSize()
) {
languages.forEachIndexed { index, language ->
RadioButtonChip(
modifier = Modifier
.fillMaxWidth(0.5f)
.offset { IntOffset(0, animateOffsetY.value.roundToInt()) },
languageName = language.languageName
)
}
}
It's expected behavior because you have only one
Animatable. If you have list ofAnimatables each RadioButtonChip will have their individual animation such as