Se7eN
10/20/2020, 4:04 PMtransitionDefinition<StoryState>{
state(StoryState.START) {
this[progress] = 0f
}
state(StoryState.END) {
this[progress] = 1f
}
transition(StoryState.START to StoryState.END) {
progress using tween(5000, delayMillis = 500, easing = LinearEasing)
}
}
I'd like to pause and resume the transition on a certain event. I guess we can't do that so what can I do?Yann Badoual
10/20/2020, 4:38 PMDoris Liu
10/20/2020, 9:36 PMAnimationClock is probably the only way to achieve that, since transition composable isn't designed to be used imperatively. We may provide a lower set of APIs support imperative use of TransitionAnimation some time in the future. But for now, I'd recommend using animatedFloat (aka the imperative API for single value animation) for this use case. 🙂Se7eN
10/21/2020, 11:52 AMManualAnimationClock I'll try using itSe7eN
10/21/2020, 5:56 PMBaseAnimationClock but it looks like dispatchTime is internal. Am I doing something wrong? @Doris LiuDoris Liu
10/21/2020, 6:04 PMManualAnimationClock for the dispatching - when you change the clockTimeMillis (conditionally based on whether you need to pause the animation) , ManualAnimationClock will automatically dispatch the new time you set to the animations subscribed to it. 🙂 This does require some wire-up for your ManualAnimationClock to observe the time change during a normal run.Se7eN
10/21/2020, 6:11 PMManualAnimationClock. Thanks 🙂Doris Liu
10/21/2020, 6:16 PM