Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit 1d25cfa14e0d7e9e33f1b9cbc7c25e8e6a37d4ab
Author: Jeremy Woods <jbwoods@google.com>
Date: Fri Mar 31 21:28:54 2023
Fix an issue with removing fragments that were not attached
When a fragment is added and removed in the same frame via a `navigate`
and `pop`, we move the Lifecycle state of entries but since the fragment
is optimized out of the fragment manager and never gets attached, the
entries do not get a signal that allows them to markTransitionComplete
and get to the proper Lifecycle state.
We should do something similar to what we do for fragments with saved
state that is cleared and used a ViewModel being cleared as the signal
to move all transitioning entries to their proper final lifecycle state.
RelNote: "When there is a `navigate` that adds an entry and a
`popBackStack` that removes it in the same frame, the resulting top
entry on the back stack will now consistently make it back to the
`RESUMED` `Lifecycle.State`."
Bug: 276495952
Test: added new tests
Change-Id: Id80678cf8856ca2de55c8adbc19b33fa0f8fbec9
M navigation/navigation-fragment/src/androidTest/java/androidx/navigation/fragment/FragmentNavigatorTest.kt
M navigation/navigation-fragment/src/main/java/androidx/navigation/fragment/FragmentNavigator.kt
https://android-review.googlesource.com/2514378
Branch: androidx-main
commit 1d25cfa14e0d7e9e33f1b9cbc7c25e8e6a37d4ab
Author: Jeremy Woods <jbwoods@google.com>
Date: Fri Mar 31 21:28:54 2023
Fix an issue with removing fragments that were not attached
When a fragment is added and removed in the same frame via a `navigate`
and `pop`, we move the Lifecycle state of entries but since the fragment
is optimized out of the fragment manager and never gets attached, the
entries do not get a signal that allows them to markTransitionComplete
and get to the proper Lifecycle state.
We should do something similar to what we do for fragments with saved
state that is cleared and used a ViewModel being cleared as the signal
to move all transitioning entries to their proper final lifecycle state.
RelNote: "When there is a `navigate` that adds an entry and a
`popBackStack` that removes it in the same frame, the resulting top
entry on the back stack will now consistently make it back to the
`RESUMED` `Lifecycle.State`."
Bug: 276495952
Test: added new tests
Change-Id: Id80678cf8856ca2de55c8adbc19b33fa0f8fbec9
M navigation/navigation-fragment/src/androidTest/java/androidx/navigation/fragment/FragmentNavigatorTest.kt
M navigation/navigation-fragment/src/main/java/androidx/navigation/fragment/FragmentNavigator.kt
jb...@google.com <jb...@google.com> #3
This has been fixed internally and will be available in the next Navigation release.
pr...@google.com <pr...@google.com> #4
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.navigation:navigation-fragment:2.6.0-beta01
ke...@hinge.co <ke...@hinge.co> #5
based on another issue here https://issuetracker.google.com/issues/287133013#comment4
the navigation issue with popUpTo has not been fixed.
can we reopen this issue and find a path going forward?
the navigation issue with popUpTo has not been fixed.
can we reopen this issue and find a path going forward?
jb...@google.com <jb...@google.com> #6
You should follow along with the bug you have linked.
Description
The top most entry on the Navigation back stack should always be `RESUMED` when in a settled UI state.