hi all!, does anybody know how can I restart a Transition?
Copy code
val currentState = remember {
MutableTransitionState(TransitionState.START)
.apply { targetState = TransitionState.END }
}
val transition = updateTransition(currentState, label = "")
the initial composition triggers the transition but I need to restart it whenever a Canvas draws something, which happens some time after the initial Transition is triggered.
I've tried doing
currentState.targetState = TransitionState.END
right before drawing inside the Canvas but it doesn't work.
d
Doris Liu
11/11/2021, 6:16 PM
You could either 1) pass a new MutableTransitionState instance to updateTransition, which will restart the transition, or 2) add a