BaseScreen
Extends BaseView
and adds additional awareness for selections, loading state, if the user is reloading, and contains utility and application level functions. Application functions proxy main application activity such as playing a video, or showing a screen.
BaseScreen fields
content
the content that this screen loadedselection
selection object for the currently selected contentisLoading
isUserChangePending
NavController
- reference to theNavController
this screen belongs to - this is the navController that will be used forpush
,pop
, andresetNavController
BaseScreen functions
getTopScreen
- can be used to ask this screen what it considers its top view. This is useful if the screen in turn composes other screens (e.g. via nested NavControllers)push
- pushes passed in screen to the navControllerpop
- pops the current navController screenresetNavController
- resets the navController - passing in a screen or index, will reset to that screen, or back to that index- other utility functions implemented for your app
BaseScreen abstract functions
BaseScreen provides the same lifecycle methods as BaseView
; but also provides
getTopScreen
- template method used bygetTopScreen
baseScreenOnShow
- special hook used to overcome needing moreonShow
overrides (SceneGraph has a limit to super method calls)onUserChange
- called when the user changes, so the view can update itself with the latest data