After Seven Years, Google Reinvents Android Navigation with Jetpack Navigation 3
Briefly

After Seven Years, Google Reinvents Android Navigation with Jetpack Navigation 3
"Specifically, as Google engineer Don Turner explains, most modern apps now follow the reactive programming paradigm. This makes it possible to radically change the way developers manage their view stack. For example, with Navigation 3 you navigate to a new view by simply adding an item to a list observed by the library's NavDisplay component. Likewise, when you want to navigate back from a screen, you remove the corresponding item from the list."
"NavDisplay then automatically updates the UI in response to changes in the list. Another major advantage of adopting Jetpack state management at the cornerstone of Navigation 3 is that it makes it straightforward to establish a single source of truth. This aligns directly with the developer-defined state. In contrast, Navigation 2 maintained its own internal state, causing the app's state to be split across the app's own representation and Navigation 2's."
Jetpack Navigation 3 reworks Android navigation by centering Jetpack state and reactive patterns, allowing developers to control the back stack directly via observable lists. Navigation actions happen by adding or removing items from a NavDisplay-observed list, causing automatic UI updates. Adopting Jetpack state enables a single source of truth aligned with developer-defined state, avoiding the split-state issue present in Navigation 2. The library is fully modularized with independent APIs that interoperate, enabling customization of animations, multi-pane layouts, and replacement of individual components for advanced, use case–specific behaviors. Navigation 3 integrates seamlessly with Jetpack Compose state management and grants full back-stack control for complex navigation flows.
Read at InfoQ
Unable to calculate read time
[
|
]