Fixed
Status Update
Comments
il...@google.com <il...@google.com>
il...@google.com <il...@google.com> #2
I've confirmed that this is fixed in alpha08 as a result of https://android-review.googlesource.com/833717 and a number of other internal changes. Once it is released, please let me know if this fixes your issue.
The second issue of hitting two things at a time is not an issue with Navigation, but an issue with Fragments not canceling click events when stopped, causing the second click event to happen even after the first navigate() operation starts.
This is fixed in AndroidX Fragments 1.1.0-alpha01 or higher as per the release notes:https://developer.android.com/jetpack/androidx/androidx-rn#2018-nov-fragment
The second issue of hitting two things at a time is not an issue with Navigation, but an issue with Fragments not canceling click events when stopped, causing the second click event to happen even after the first navigate() operation starts.
This is fixed in AndroidX Fragments 1.1.0-alpha01 or higher as per the release notes:
Description
Version used: alpha 0.0.5
Devices/Android versions reproduced on: Android 8.1 Oneplus 3T, Android 6.0 Moto G Turbo edition
I made a sample project which consists of a main activity and 2 fragments, FragmentA and FragmentB
Fragment A has a button to fragment B
Fragment B simply states that you are on fragment B
The main activity listens for and logs which page you are on when you navigate
The main activity has 4 buttons
1 - Pop - Calls navigation controllers popBackStack() method
1 - Pop to root - Calls navigation controllers popBackStack() method with fragment A as a destination and inclusive set to false, so you get back to the top of the stack
3 - Up - calls navigation controllers navigateUp method
4 - Check page, gives a toast with the current destinations label
The bugs:
1) If you press pop when on the home screen, you end up still on the home screen but the navigation controller seems to forget where it is. The current destination becomes null but im still on page a. I can still go to page b too. But once on page b, all further navigation fails. Not sure if this is a bug or intentional
2) To get around this i used pop to root instead. This one works fine most the time but if you hit the button for going to fragment b and simultaneously hit the pop to root button, sometimes, if you time it right, it breaks the backstack. The current destination button tells me I'm on A, the backstack size (checked via debugger) also suggests I'm on A, and therefore pop and pop to root both stop working (since it thinks I'm already at the top). Yet I see B on my screen. Checking the navigation listener, it thinks im on A too (that's the last thing logged). I'm assuming some sort of race condition or something is causing this.
When the backstack is broken in either of these 2 ways, i can still use the up button, but it causes the activity to recreate (judging by the code, i think it thinks I'm deep linked into fragment B)
Also when it is broken via
The sample project is attached.