Zoltan Demant
09/27/2022, 4:37 AMAnimatedContent
skips the transition sometimes, despite targetState having changed. Why could that be? Potential bug? Code in π§΅Zoltan Demant
09/27/2022, 4:47 AMAnimatedContent(
targetState = size,
transitionSpec = {
if (targetState > initialState) {
SlideEnterVertically
} else {
SlideExitVertically
}
},
content = { index ->
val content = contentMap[index]
stateHolder.SaveableStateProvider(
key = index,
content = content,
)
},
)
Zoltan Demant
09/27/2022, 4:48 AMslideInVertically
with fadeOut
SlideExitVertically is fadeIn
with slideOutVertically
Zoltan Demant
09/27/2022, 4:54 AMOleksandr Balan
09/27/2022, 7:11 AMZoltan Demant
09/27/2022, 7:31 AMZoltan Demant
09/27/2022, 7:43 AMOleksandr Balan
09/27/2022, 7:44 AMcan reproduce it by decreasing size twice in a short period of time (<5 ms between)Aha, I thought you can only reproduce it when pressing back π€· But could be the same cause π€
Zoltan Demant
09/27/2022, 9:51 AMDoris Liu
09/27/2022, 6:48 PMZoltan Demant
09/28/2022, 12:03 PMDoris Liu
09/28/2022, 5:36 PMDoris Liu
09/28/2022, 5:37 PMDoris Liu
09/28/2022, 5:46 PMtransition.currentState
and transition.targetState
in AnimatedContent to see how long it took for the enter animations and exit animations to really finish. Each set of content will have their own Transition
, and they are all child transitions of the AnimatedContent's Transition.Doris Liu
09/28/2022, 5:47 PMZoltan Demant
09/29/2022, 3:37 AMZoltan Demant
09/29/2022, 3:40 AMZoltan Demant
09/29/2022, 3:40 AMDoris Liu
09/29/2022, 6:01 PMAlso, just to ping back to what this thread was originally about - do you think the animation interrupt "bug" is whats causing the above animation to be skipped at times?Without a repro case, my guess is yes. If you could give me a reproducible skipping. I'd love to investigate. As I'm looking at the animation interruption bug, it seems that when the outgoing content becomes incoming, it records the wrong exit transition when interrupted and tries to reverse that exit transition to become fully visible. For example, instead of trying to reverse a slide out, it would reverse the fade out in your use case. Since the alpha is already at 1f, there's nothing to change, it'll finish the animation immediately. That would be perceived as animation skipping. This issue will be fixed soon, sorry about the wait. π
Doris Liu
09/29/2022, 6:05 PMWhen interrupted: For all the use-cases I have, it would always make sense for the animation to continue towards the new value. Exactly like animateValueAsState does it.Curious if you would prefer a sequential change - if transition A->B is interrupted by C, it'd go ahead and finish the A-B section before proceeding to C. Would that be preferable over interrupting B's enter transition and make it exit right away?
Zoltan Demant
09/30/2022, 5:05 AMDoris Liu
09/30/2022, 7:01 PMExitTransition.None after fadeIn() + ...
instead of using with
. Sequential animations come with its own set of issues around interruptions. So maybe we'll take a different approach to support this request.
I think Id prefer the sequential approach. It seems like it would hit the sweet spot all of the time for my use-cases at least.I'm starting to think it'd make sense to also have an option to queue up interruptions. Sounds like it'd benefit your use case as well. Thanks for the feedback!
Zoltan Demant
10/03/2022, 1:13 PMDoris Liu
10/03/2022, 8:53 PMIm pretty sure that the horizontal versions would do the same, but fade/scale does not regardless of what values I pass in.That's an interesting observation. The fade/scale indeed have a different impl than shrink/expand/slide. I just checked the implementation nothing really stood out. If you have a repro that'd be the most helpful. If not, you could try out the fix I recently submitted when it's released in a couple of weeks. They may have the same root cause.
Doris Liu
10/05/2022, 4:15 PMZoltan Demant
10/26/2022, 7:05 AMDoris Liu
10/27/2022, 3:22 AMZoltan Demant
10/27/2022, 5:06 AMslideOutVertically
to be able to finish its work as well? That seems impossible (correct me if Im wrong) considering the spring type deal, but at least good to know if I fully comprehend the issue πDoris Liu
10/28/2022, 6:04 PM