Navigation Component, feedback from the trench
summary
Explains concrete tradeoffs of Navigation Component with real code patterns: testing by faking NavController, a flow manager that centralises navigation logic, and dealing with a 66‑screen form flow that needed a map of destination->action. Shows hacks that work — a custom fragment_tab navigator and using multiple NavHost instances to keep per‑tab back stacks — plus a Gradle trick for shared nav graphs in multi‑module projects. Mentions where the library crashes (restore state on rotate) and what actually works.
AI-written summary · about
chapters (20)
- 0:00Navigation Component Feedback From The Trench
- 1:39Slides bit.ly/nav-component
- 2:17The big picture
- 3:45A basic example
- 10:49Additional features
- 12:20Specific use cases
- 18:07Testing the navigation
- 20:34Conditional navigation
- 23:07When a destination contains a single action, use a generic ID
- 29:59Handling multi start points
- 35:09Fragmentless navigation
- 37:39Bottom navigation
- 40:45The problem: Fragments are destroyed when a tab is opened
- 42:12The hack: Use several NavHostFragments to create several back stacks
- 43:35Multi module navigation
- 45:54Missing navigation IDs in the features
- 46:23Let's look at the SafeArgs Gradle plugin source code!
- 47:382 lines fix, using an official API
- 47:57Single Activity?
- 48:07Nav Component works perfectly on multi activities pattern
related talks
43mNavigation Component, feedback from the trench
33mAdventures in Navigation
38mAdventures in Navigation
30mBreaking the Rules: Dynamic Navigation in Modularized Apps
14mNavigation Compose on every screen size
36mAdventures in Navigation
41mBottom Navigation Headache
33mFinding Your Way Through the Navigation Framework
