On Android views, we had an animation using an OvershootInterpolator
We want to replicate the same animation in Jetpack Compose.
I see that there are several AnimationSpec described in https://developer.android.com/jetpack/compose/animation but I don't see which one might replicate the OvershootInterpolator
tweenspec doesn't seem to do any overshoot, just animating between start and end value without overshootingspringspec does overshooting, however it doesn't have adurationMillisparameter as tween, so we can't control how fast it playskeyFramesspec seems a possible solution by doing something like this:animationSpec = keyframes { durationMillis = 500 0f at 100 with FastOutSlowInEasing // Overshoot value to 50f 50f * 2 at 300 with LinearOutSlowInEasing // Actual final value after overshoot animation 25f at 500 }
Is there a better / simpler way than using keyFrames to replicate OvershootInterpolator?