Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Use Markdown for this comment
Set severity, which reflects how much the issue affects the use of the product
Change issue status back to 'Assigned'
Pending code changes (auto-populated)
[ID: 84651]
Story points rate the relative effort of work in a Fibonacci-like format: 0, 0.5, 1, 2, 3, 5, 8, 13, 20, 40, 100. Each team will estimate work on a slightly different scale, which means the values in this field are likely only meaningful to the team that owns the Buganizer component in which the issue resides.
See Atlassian's Agile Coach for more information on how to use story points for estimation: https://www.atlassian.com/agile/project-management/estimation [ID: 746686]
Set the version(s) of the product affected by this issue (comma-separated list)
Set the version(s) of the product in which the issue should be fixed (comma-separated list)
Set the version(s) of the product in which the issue fix was verified (comma-separated list)
Set if this issue occurs in production
[ID: 85206]
Set Reporter
Set Type
Set priority, which reflects how soon the issue should be fixed
Set Status
Set Assignee
Set Verifier
Remove item
View or edit staffing
View issue level access limits(Press Alt + Right arrow for more information)
Description
#1Version used: 1.0.0-alpha09
Devices/Android versions reproduced on: N/A
I have started to make use of the Navigation Component and am very please with it. Well done!
Once recommendation I would like to make, however, is to add some better support for configuring custom Destinations when used with the NavHostFragment. The problem that I am having is that in order to configure a custom Destination Navigator, I need to get reference to the NavigatorProvider from the NavController. If I am using a NavHostFragment, then I must first load the Fragment to have its onCreate method called. I then must call navController.navigatorProvider.addNavigator(...) BEFORE I subsequently call navController.setGraph(...). This means that I cannot specify the graph directly in my XML. In fact, if I make use of the app:navGraph attribute I get a crash because my custom Destination nodes have no configured Navigators.
I've looked into extending NavHostFragment with an implementation that automatically calls navigatorProvider.addNavigator(...). But since the NavController is instantiated in NavHostFragment.onCreate() and the XML-configured graph resource ID is handled in the same method, there is no integration point between these 2 operations that allows for additional Navigators to be configured before the graph xml is inflated. As a result the only way that I've found to do the configuration is do the following:
1. Do NOT specify the NavHostFragment via a fragment tag in the XML. Instead add a FrameLayout container.
2. Manually instantiate an instance of NavHostFragment, and load it via a FragmentTransaction.
3. Manually configure the custom Destination Navigator via navHostFragment.navController.navigatorProvider.addNavigator(...)
4. Manually call navHostFragment.navController.setGraph(...)
It's not a huge problem, but it did take a good bit of experimenting before I figured this out. (I.e. the docs for custom destinations could be better.)
Perhaps a later version of NavHostFragment could have an additional overridable method that could be overridden to specify a list of additional Navigators. ?