Jetpack Navigation: Getting Started

Aug 10 2021 · Kotlin 1.4, Android 11, Android Studio 4.2.1

Part 3: Add Animations & Deep Links

09. Global Actions

Episode complete

Play next episode

Next
About this episode
Leave a rating/review
See forum comments
Cinema mode Mark complete Download course materials
Previous episode: 08. Animate Transitions Between Destinations Next episode: 10. Implement an Explicit Deep Link

Get immediate access to this and 4,000+ other videos and books.

Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and 4,000+ professional videos in a single subscription, it's simply the best investment you can make in your development career.

Learn more Already a subscriber? Sign in.

Transcript: 09. Global Actions

When you click Go to Welcome either from Login screen or SignUP screen, you reach the same destination , that’s Welcome screen. For common Destinations, you can reuse actions by declaring them outside of any destination tags.

Such actions are called Global actions. You’ll now make showing Welcome screen a global action. Open your navigation graph.

Move actionWelcomeFromLogin from inside fragment to direct child of Navigation, rename it to actionWelcome. Now delete actionWelcomeFromSignUp Now go to LoginFragment

Correct the action name to actionWelcome . Go to SignUpFragment. Correct the action name to actionWelcome. Build and run the app.

Click Log In button. Enter details and Login. Click Go to Welcome and you can see Global action works. Verify same for SignUp.

Click Sign Up button. Enter details and Sign Up. Click Go to Welcome and you can see Global action works.