Status Update
Comments
ti...@google.com <ti...@google.com> #2
George, could you please take a look at this? Thanks!
mo...@google.com <mo...@google.com> #3
This looks like the same problem as
jb...@google.com <jb...@google.com> #4
Sorry about missing the repro! I retried using ToT animation and still seeing the error. You can use Basic Nav Demo
but any should work) and cancelling a back gesture will show the behavior.
mo...@google.com <mo...@google.com> #5
I'm not seeing any error. I've attached a video.
jb...@google.com <jb...@google.com> #6
That is the Navigation Fragment test app. This issue is about the Navigation Compose so you will need to use the
mo...@google.com <mo...@google.com> #7
Thanks! I was able to reproduce the problem. As we discussed, the weird fade effect is unfortunately part of the design for interruption. It is a real downside to this design.
I uploaded a change on top of your CL: aosp/3159777 that does a reverse seek when you cancel the predictive back. There are multiple ways to do this and I just chose to use an animate()
. You could also do this with a withFrameTimeNanos()
. I tried that and it works, but is a few more lines of code and I don't think it is as easy to understand.
Please try this out and see if it solves the issues.
er...@gmail.com <er...@gmail.com> #8
I have a similar issue with canceling Beck Gesture. When I apply Modifier.animateEnterExit
to a Composable function inside of one route in NavHost, it doesn't behave as expected and enters the wrong state.
Sample project:
Description
Jetpack Compose version:1.7.0-beta03 Jetpack Compose component used: compose-animation, navigation-compose Android Studio Build: 2024.1.2 Canary 5 Kotlin version: 1.9.24
When you cancel a Predictive Back gesture that has been
seekTo
'd using aSeekableTransitionState
, if you try toanimateTo()
the starting state, instead of animating from the current fraction of theSeekableTransitionState
, the animation starts all the way over.There is currently a work around in
NavHost
, but ideally when this is fixed, the workaround will be removed and it will just callanimateTo
.