https://kotlinlang.org logo
Title
t

Tiago Nunes

08/11/2022, 5:50 PM
Hi guys, I'm facing an issue with compose
navigation-animation
: When I interrupt the transition to another screen by pressing the back button, the animation gets bugged (List screen moves up a bit). I found this issue tracker link, which is probably the cause: AnimatedContent sets incorrect target animation on interrupt Has this ever happen to any of you, and is there a solution? In the video, you can see the expected behaviour happening in the second attempt, and the bug happens in the first and third attempts.
The List screen has default transitions. The Details screen has these transitions:
enterTransition = {
    slideIntoContainer(
        AnimatedContentScope.SlideDirection.Up,
        animationSpec = tween(400)
    )
},
popExitTransition = {
    slideOutOfContainer(
        AnimatedContentScope.SlideDirection.Down,
        animationSpec = tween(200)
    )
},
@Oleksandr Balan @Zoltan Demant Sorry guys, does the mean you want more info?
z

Zoltan Demant

08/11/2022, 6:07 PM
Just recognizing that I'm experiencing the same thing! If I recall correctly, there was a discussion about this a while back - I'll see if I can find it tomorrow :)
t

Tiago Nunes

08/11/2022, 6:08 PM
Thanks @Zoltan Demant appreciate it 🙌
i

Ian Lake

08/11/2022, 11:48 PM
Yep, we had looked into this particular issue in https://github.com/google/accompanist/issues/1100 and found that it is indeed an issue in
AnimatedContent
which can't be worked around at the
AnimatedNavHost
level, hence why we filed that issue tracker bug to fix the root issue. I don't know of any workaround, unfortunately
z

Zoltan Demant

08/12/2022, 4:17 AM
@Tiago Nunes I couldnt find it, but what Ian mentioned is spot on 👌🏽
f

Filip Wiesner

08/12/2022, 6:46 AM
Please upvote the google issue if you have this problem 🙏
t

Tiago Nunes

08/12/2022, 11:51 AM
Thanks guys!