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)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Unintended behavior
View staffing
Description
Version used: 1.0.0-alpha01
When using a global action (an action attached to a <navigation> element), all of the destinations under that <navigation> element should extend the <navigation> element's Directions class. This ensures that the final Directions object contains all of the valid actions from that destination on all levels of the navigation graph.
For example:
<navigation
xmlns:android="
xmlns:app="
app:startDestination="@id/main_fragment">
<fragment
android:id="@+id/main_fragment"
android:name=".MainFragment">
<action
android:id="@+id/start_login"
app:destination="@id/login"/>
</fragment>
<navigation
android:id="@+id/login"
app:startDestination="@id/login_fragment">
<action
android:id="@+id/action_done"
app:popUpTo="@id/main_fragment"/>
<fragment
android:id="@+id/login_fragment"
android:name=".LoginFragment">
<action
android:id="@+id/register"
app:destination="@id/register_fragment"/>
</fragment>
<fragment
android:id="@+id/register_fragment"
android:name=".RegisterFragment">
</fragment>
</navigation>
</navigation>
There should be
- A LoginDirections class that has an action_done() method (this works right now).
- A LoginFragmentDirections class that extends LoginDirections (currently it does not extend anything)
- An empty RegisterFragmentDirections class that extends LoginDirections (currently it does not exist)