Fixed
Status Update
Comments
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #2
Activity destinations should be considered exit points for your navigation graph - they are not part of the NavController's back stack and therefore not being sent to OnNavigatedListeners is working as intended.
il...@google.com <il...@google.com> #3
Thank you for your explanation, but although that is the intended behavior, it is still confusing.
In my opinion, the developer expects to be notified when any navigation action defined in the graph is performed, regardless the destination.
Although that action is considered an exit point, it is an action defined within the graph and it is indeed a navigation action happening in that graph, so I don't understand why it is not notified to the "OnNavigated" listener when it has indeed navigated, regardless if it affects or not the back stack.
I that is the intended behaviour, then it should be rather called something like "NavController.OnBackStackChangedListener".
In my opinion, the developer expects to be notified when any navigation action defined in the graph is performed, regardless the destination.
Although that action is considered an exit point, it is an action defined within the graph and it is indeed a navigation action happening in that graph, so I don't understand why it is not notified to the "OnNavigated" listener when it has indeed navigated, regardless if it affects or not the back stack.
I that is the intended behaviour, then it should be rather called something like "NavController.OnBackStackChangedListener".
ap...@google.com <ap...@google.com> #4
Yeah, naming is hard :)
Right now, NavController.OnNavigatedListener gives you a NavDestination that always equals navController.getCurrentDestination(). It doesn't give you what action you triggered, arguments, or anything else (including operations that don't change getCurrentDestination(), such as singleTop actions or activity destinations), so I could definitely see this more as a OnDestinationChangedListener.
I'll reopen this to track renaming the listener to something more appropriate to what it actually is doing or updating the documentation to make its role more clear.
Right now, NavController.OnNavigatedListener gives you a NavDestination that always equals navController.getCurrentDestination(). It doesn't give you what action you triggered, arguments, or anything else (including operations that don't change getCurrentDestination(), such as singleTop actions or activity destinations), so I could definitely see this more as a OnDestinationChangedListener.
I'll reopen this to track renaming the listener to something more appropriate to what it actually is doing or updating the documentation to make its role more clear.
Description
Version used: 1.0.0-alpha06
Currently, NavigationUI is hard coded to only hide the Up button on the start destination of the navigation graph. Particularly in cases where you're using bottom nav or a navigation drawer, it is advantageous to hide the Up button on all of those top level destinations.
NavigationUI should offer a way to pass in exactly what those top level destinations are. It should default to the start destination of the navigation graph, as it was before.