BackStackContainer
A container view that can display a stream of BackStackScreen instances.
This container supports saving and restoring the view state of each of its subviews corresponding to the renderings in its BackStackScreen. It supports two distinct state mechanisms:
Classic view hierarchy state (View.onSaveInstanceState/View.onRestoreInstanceState)
AndroidX SavedStateRegistry via SavedStateRegistryOwner.
Constructors
Properties
Returns the most recent ViewEnvironment applied to this view, or null if the receiver was not initialized via ScreenViewHolder.startShowing.
Returns the most recent Screen rendering shown in this view, or throws a NullPointerException if the receiver was not created via ScreenViewFactory.startShowing.
Returns the most recent Screen rendering shown in this view, or null
if the receiver was not initialized via ScreenViewHolder.startShowing.
Functions
Returns the bounds of this View in the coordinate space of the device screen, based on View.getLocationOnScreen and its reported width and height.
Looks for a View's OnBackPressedDispatcherOwner via the usual findViewTreeOnBackPressedDispatcherOwner method, and if that fails checks its Context.
Wrapper for the two arg variant of setBackHandler, a convenience for the common pattern of using a nullable function as the back handler to indicate that back handling should be disabled.
A function to be called if the device back button is pressed while this view is active, as determined by its ViewTreeLifecycleOwner, via an OnBackPressedCallback. On succeeding calls, the previously created OnBackPressedCallback will be updated, and will maintain its position in the OnBackPressedDispatcher priority queue.