-
Notifications
You must be signed in to change notification settings - Fork 77
3. Installation
Simple-Stack manages a list of parcelables that represent the navigation history. These can also be associated with a scope, where this scope can describe services that should be available for a given screen. These services can receive lifecycle callbacks and support saved-state persistence.
This allows simple, declarative way to describe the classes we need on a given screen, while also receiving important callbacks to make our app survive configuration changes and process death reliably.
The Navigator allows automatic installation of the Backstack, so that you don't need to worry about providing the right lifecycle callbacks.
It also makes the Backstack accessible from any class that has access to the Activity context (for example, fragments or views).
When using custom views, it can be even as simple as Navigator.install(activity, container, History.of(InitialScreen())
.
When using fragments, this typically requires the activity to be a NavigationHandler
, that delegates the navigation state changes to the FragmentStateChanger
.
See the tutorials on actual code snippets.