Status Update
Comments
cl...@google.com <cl...@google.com> #2
ap...@google.com <ap...@google.com> #3
ap...@google.com <ap...@google.com> #5
Branch: androidx-main
commit c73552953192ba60a879f5e51218f6e157a24beb
Author: Clara Fok <clarafok@google.com>
Date: Tue Feb 28 14:47:30 2023
Add FragmentNavigator test
Ensure initial fragments and their entries are correctly replaced and destroyed when navigate and popping consecutively
Test: ./gradlew navigation:navigation-fragment:cC
Bug: 269646882
Change-Id: I552ddd3d74f20612c4c91336eb4af9e6aa99c146
M navigation/navigation-fragment/src/androidTest/java/androidx/navigation/fragment/FragmentNavigatorTest.kt
M navigation/navigation-fragment/src/androidTest/res/navigation/nav_simple.xml
na...@google.com <na...@google.com> #6
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.navigation:navigation-fragment:2.6.0-alpha07
tp...@gmail.com <tp...@gmail.com> #7
NavBackStackEntry is still not triggering RESUMED on androidx.navigation:navigation-fragment:2.6.0-alpha09
in certain cases, where after a locale or uiMode change with
AppCompatDelegate.setApplicationLocales
AppCompatDelegate.setDefaultNightMode
Issue can be reproduced with attaching LifecycleObserver to the currentBackStackEntry of a Home fragment like so:
findNavController().currentBackStackEntry?.lifecycle?.let {
if (it.currentState.isAtLeast(Lifecycle.State.RESUMED)) {
Timber.d(Constants.LOG_INFO, "lifecycle.currentState", "resumed")
} else {
val testLifecycleObserver = object : DefaultLifecycleObserver {
override fun onResume(owner: LifecycleOwner) {
Timber.d(Constants.LOG_INFO, "lifecycle.currentState", "onResumed")
it.removeObserver(this)
}
}
it.addObserver(testLifecycleObserver)
}
}
After performing a config change as mentioned above on a Settings fragment, upon performing a popBackStack/navigateUp to Home fragment, the DefaultLifecycleObserver's onResume will not be triggered. Issue does not occur if a config change is not performed.
jb...@google.com <jb...@google.com> #8
I believe this was actually addressed as part of the Navigation
Description