Status Update
Comments
st...@gmail.com <st...@gmail.com> #2
I tested on latest stable (afaik) Android 14 too (AP1A.240505.005) and I can see the same broken behavior too.
Disabling predictive back on developer options for Android 14 also does not fix the problem actually, since that only disables the animation exiting the app. But the in-app predictive back animation is still broken in the same way.
On Android 15 the option is not there at all it seems, so this does not apply there either. The bug exists in all cases.
jb...@google.com <jb...@google.com>
ap...@google.com <ap...@google.com> #3
Branch: androidx-main
commit ea936f8359250bc9cb4c6c92bed301146c5dc57e
Author: Jeremy Woods <jbwoods@google.com>
Date: Tue Jun 18 22:48:49 2024
Move entries to proper state when finishing predictive back
For Navigation Compose, when doing a predictive back gesture, if the
gesture is cancelled, the NavBackStackEntry never gets its Lifecycle
RESUMED again.
Ideally, the `animateTo()` API on `SeekableTransitionState` would handle
the cancel case for us, but it restarts the animation instead of
continuing from the most recent state of the animation. So navigation
needs to handle this case explicitly and we can remove the fix once
`animateTo()` does handle it.
RelNote: "Fixed an issue in Navigation Compose where after cancelling
the Predictive Back Gesture, the NavBackStackEntry that the user returns
to never moves back to RESUMED."
Test: added NavHostPredictiveBackTest
Bug: 346608857
Change-Id: I97a0c5fe7fe661a2fadfbb01346676482d426028
A navigation/navigation-compose/src/androidTest/java/androidx/navigation/compose/NavHostPredictiveBackTest.kt
M navigation/navigation-compose/src/main/java/androidx/navigation/compose/NavHost.kt
jb...@google.com <jb...@google.com> #4
This has been fixed internally and will be available in the Navigation 2.8.0-beta04
release.
pr...@google.com <pr...@google.com> #5
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.navigation:navigation-compose:2.8.0-beta04
eb...@gmail.com <eb...@gmail.com> #6
Maybe something similar exists also on shared content transition? I've just opened a file
(just the note the fix here is indifferent about my issue as could see it both in beta03 and beta04)
(and I'll understand if you see that issue as invalid as it's my duty to replicate that locally first even though it's GitHub Actions and don't have access to the machine, still)
Description
Component used: Navigation
Version used: 2.8.0-beta02
Devices/Android versions reproduced on: VanillaIceCream(AP31.240426.023.B4) with Predictive back in developer options turned on
With a new project generated from Android Studio, I added
android:enableOnBackInvokedCallback="true"
and I bumped all dependencies to the latest available, where the relevant ones are:Then MainActivity looks like this:
And doing this interaction:
Noticed this bug as I could not longer navigate in my codebase since I got my nav events wrapped in
dropUnlessResumed {}
which at that point means you're dropping all of those those.