In Jetpack Compose Animation, for tween AnimationSpec, we can have a delay
val translationY by transition.animateFloat(
transitionSpec = {
tween(
delayMillis = 1000, // Delay here
durationMillis = 2000
)
},
label = ""
) { if (it) 0f else 180f }
However, for Spring AnimationSpec, we only have dampingRatio (0.25f shown below) and Stiffness (100f shown below). There's no way to add a delay.
val translationY by transition.animateFloat(
transitionSpec = {
spring(0.25f, 100f)
},
label = ""
) { if (it) 0f else 180f }
How to add a delay for Animation using Spring AnimationSpec?