Halil Ozercan
07/23/2020, 7:41 PMTransition
composable is deprecated in favor of transition
which is highly similar but instead of receiving children as a trailing lambda, it provides a state that can be used by following composables in the same scope. The docs suggest that toState
is the main control unit for transition state. Whenever it changes, animation will change the course to this new destination state whether the animation was running or not. However, I'm having trouble understanding how to reset the current animation all together.
Let's say my initial configuration is to go from A
to B
. In the middle of this transition, Composable receives a new state, which means the animation needs to restart. Animation should go back to state A
and again head for B
. I could not find a way of simply resetting initState
and toState
at the same time. What is the recommendation for such behavior?Ian Lake
07/23/2020, 7:50 PMHalil Ozercan
07/23/2020, 7:56 PMtransitionDefinition
, there are no shortcuts between states. I wish there was an easy way to reset animation state for simple use cases.Doris Liu
07/23/2020, 8:14 PMHalil Ozercan
07/23/2020, 8:39 PMDoris Liu
07/24/2020, 7:08 PMsnapTo
, animateTo
and in some cases fling
. I'll consider having a similar variant for transition.