You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: swipe back from activity details stalls, then snaps #1852
A swipe back from Activity details plays the wrong animation and then stalls. During the gesture the details screen slides left and dims while Home comes in from the right, which is the forward enter/exit pair rather than the pop pair. It then holds half-faded for about half a second and disappears at once, instead of sliding out to the right.
How it looks depends on how soon the swipe follows the tap:
About 0.6 s after opening details: the forward pair follows the finger, holds, then snaps to Home.
A few seconds after opening: details shrinks to about 70% (navigation-compose's default predictive-back scaleOut), holds, then snaps to Home.
The Back key is not affected: it slides details out to the right as before.
Expected behavior
Swipe back plays the pop pair, as in 3.1.0: details slides out to the right while Home slides back in from the left. It finishes smoothly at any timing.
Steps to Reproduce
Open Home with a few activities (Dev Settings → Generate Test Activities on a dev build).
Tap an activity row to open its details.
Within about a second, swipe back from the left edge.
Logs / Screenshots / Recordings
Root cause: fd6949c from #1787 (chore: bump the gradle group across 1 directory with 41 updates) moved androidx.navigation:navigation-compose from 2.9.6 to 2.10.2.
fd6949c's parent (navigation-compose 2.9.6) is clean at both swipe timings.
That parent with only navCompose = "2.10.2" (plus the compileSdk 37 that version requires) reproduces the bug at both timings.
fd6949c alone doesn't build, because it needs compileSdk 37 from 034bf57, a later commit of the same PR; that's why the isolation build above was needed.
Navigation 2.10 rewrote NavHost's predictive back on top of the NavigationEvent API:
During a gesture it no longer uses each destination's popEnterTransition / popExitTransition.
It uses new NavHost-level predictivePopEnterTransition / predictivePopExitTransition, which default to fadeIn / scaleOut(0.7f).
A gesture started soon after a forward navigation seeks with the forward spec instead.
Setting the new NavHost-level predictive transitions changes neither swipe: the late one still shrinks and snaps, the early one keeps the forward pair. So the fix is to pin navigation-compose to 2.9.8, the newest 2.9.x.
Activity