Fixed
Status Update
Comments
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 547f711e980066aac5abd4b648f371f92e7faefc
Author: Ian Lake <ilake@google.com>
Date: Mon May 13 11:06:34 2019
Add callback for when the primary nav fragment changes
Make it possible for Fragments to know when they
become the primary navigation fragment. This allows
subclasses of Fragment to enabled/disable their own
OnBackPressedCallback instances at the same time
the child FragmentManager does so.
Test: updated PrimaryNavFragmentTest
BUG: 132077777
Change-Id: Ib0193437eb33f934610ca33ec804054e60ff87ae
M fragment/api/1.1.0-alpha09.txt
M fragment/api/current.txt
M fragment/src/androidTest/java/androidx/fragment/app/PrimaryNavFragmentTest.kt
M fragment/src/main/java/androidx/fragment/app/Fragment.java
M fragment/src/main/java/androidx/fragment/app/FragmentManagerImpl.java
https://android-review.googlesource.com/960857
https://goto.google.com/android-sha1/547f711e980066aac5abd4b648f371f92e7faefc
Branch: androidx-master-dev
commit 547f711e980066aac5abd4b648f371f92e7faefc
Author: Ian Lake <ilake@google.com>
Date: Mon May 13 11:06:34 2019
Add callback for when the primary nav fragment changes
Make it possible for Fragments to know when they
become the primary navigation fragment. This allows
subclasses of Fragment to enabled/disable their own
OnBackPressedCallback instances at the same time
the child FragmentManager does so.
Test: updated PrimaryNavFragmentTest
BUG: 132077777
Change-Id: Ib0193437eb33f934610ca33ec804054e60ff87ae
M fragment/api/1.1.0-alpha09.txt
M fragment/api/current.txt
M fragment/src/androidTest/java/androidx/fragment/app/PrimaryNavFragmentTest.kt
M fragment/src/main/java/androidx/fragment/app/Fragment.java
M fragment/src/main/java/androidx/fragment/app/FragmentManagerImpl.java
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 1150a1ed5169dcb2a02802272bf5b5408697ae87
Author: Ian Lake <ilake@google.com>
Date: Mon May 13 13:24:32 2019
Allow NavHosts to enable/disable OnBackPressedCallback
Ensure that a NavHostFragment can correctly control
the enabled/disabled state of the NavController's
OnBackPressedCallback so that it remains in sync
with whether the the NavHostFragment is the primary
navigation fragment.
Importantly, enabling/disabling the callback is
strongly preferred over removing/re-adding the callback
as it ensures that the lifecycle ordering remains
consistent between the NavController and child
FragmentManagers.
By making it a return object from the
setHostOnBackPressedDispatcherOwner(), the control
is restricted to the NavHost only (and those the
NavHost wants to make it available to) rather than
to all accessors of the NavController.
Test: new OnBackPressedTest
Fixes: 132077777
Change-Id: I2bcc33bbf610e155e6bc4c14ba3106b57d0d6418
M fragment/src/main/java/androidx/fragment/app/Fragment.java
M navigation/fragment/src/androidTest/java/androidx/navigation/fragment/OnBackPressedTest.kt
M navigation/fragment/src/main/java/androidx/navigation/fragment/NavHostFragment.java
M navigation/runtime/api/2.1.0-alpha04.txt
M navigation/runtime/api/current.txt
M navigation/runtime/src/main/java/androidx/navigation/NavController.java
https://android-review.googlesource.com/961136
https://goto.google.com/android-sha1/1150a1ed5169dcb2a02802272bf5b5408697ae87
Branch: androidx-master-dev
commit 1150a1ed5169dcb2a02802272bf5b5408697ae87
Author: Ian Lake <ilake@google.com>
Date: Mon May 13 13:24:32 2019
Allow NavHosts to enable/disable OnBackPressedCallback
Ensure that a NavHostFragment can correctly control
the enabled/disabled state of the NavController's
OnBackPressedCallback so that it remains in sync
with whether the the NavHostFragment is the primary
navigation fragment.
Importantly, enabling/disabling the callback is
strongly preferred over removing/re-adding the callback
as it ensures that the lifecycle ordering remains
consistent between the NavController and child
FragmentManagers.
By making it a return object from the
setHostOnBackPressedDispatcherOwner(), the control
is restricted to the NavHost only (and those the
NavHost wants to make it available to) rather than
to all accessors of the NavController.
Test: new OnBackPressedTest
Fixes: 132077777
Change-Id: I2bcc33bbf610e155e6bc4c14ba3106b57d0d6418
M fragment/src/main/java/androidx/fragment/app/Fragment.java
M navigation/fragment/src/androidTest/java/androidx/navigation/fragment/OnBackPressedTest.kt
M navigation/fragment/src/main/java/androidx/navigation/fragment/NavHostFragment.java
M navigation/runtime/api/2.1.0-alpha04.txt
M navigation/runtime/api/current.txt
M navigation/runtime/src/main/java/androidx/navigation/NavController.java
ap...@google.com <ap...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-master-dev
commit db2ddf334f6cd1fab297b816b5d8f50d7da7fa09
Author: Ian Lake <ilake@google.com>
Date: Tue May 14 10:18:42 2019
Change NavHostOnBackPressedManager to final class
Instead of an interface that other classes can
implement, change NavHostOnBackPressedManager to a
final class that can only be implemented by
NavController.
Test: ./gradlew checkApi
BUG: 132077777
Change-Id: I8338e8b388fc483dd43cf877e617c3d71f9f3443
M navigation/runtime/api/2.1.0-alpha04.txt
M navigation/runtime/api/current.txt
M navigation/runtime/src/main/java/androidx/navigation/NavController.java
https://android-review.googlesource.com/961461
https://goto.google.com/android-sha1/db2ddf334f6cd1fab297b816b5d8f50d7da7fa09
Branch: androidx-master-dev
commit db2ddf334f6cd1fab297b816b5d8f50d7da7fa09
Author: Ian Lake <ilake@google.com>
Date: Tue May 14 10:18:42 2019
Change NavHostOnBackPressedManager to final class
Instead of an interface that other classes can
implement, change NavHostOnBackPressedManager to a
final class that can only be implemented by
NavController.
Test: ./gradlew checkApi
BUG: 132077777
Change-Id: I8338e8b388fc483dd43cf877e617c3d71f9f3443
M navigation/runtime/api/2.1.0-alpha04.txt
M navigation/runtime/api/current.txt
M navigation/runtime/src/main/java/androidx/navigation/NavController.java
il...@google.com <il...@google.com> #5
We've fixed this internally and it will be available in Navigation 2.1.0-alpha04
Description
Version used: 2.1.0-alpha03
It seems like the work in
- using app:defaultNavHost="false" or leaving the attribute out entirely
- Manually changing the primary navigation fragment as per
Where the NavHostFragment / NavController continues to intercept back button events, basically treating the NavHostFragment as if it always is the defaultNavHost.