Luka
08/08/2022, 8:13 AMjames
08/08/2022, 11:22 PMupdateTransition()
and an enum to represent the animation state
in your situation you could do
enum class MyAnimState {
Initial,
ScaledUp,
ScaledDown,
Finished;
fun next() = when (this) {
Initial -> ScaledUp
ScaledUp -> ScaledDown
ScaledDown -> Finished
Finished -> Initial
}
}
using this and a when statement for each of your animatable values you can define values for each state, and by having something like:
if (transition.targetState == transition.currentState) {
myAnimState = myAnimState.next()
}
you can automatically progress to the “next” state once each one has finishedLuka
08/09/2022, 12:50 PMval color by transition.animateColor(...)
How can i animate change of painterResource based on MyAnimState (image swap)?james
08/10/2022, 12:38 AMtargetState
in an AnimatedContent that is a parent of your imagejames
08/10/2022, 12:39 AM