ViewStateCache
Handles persistence chores for container views that manage a set of NamedScreen renderings, showing a view for one at a time -- think back stacks or tab sets.
Provides Parcelable-based save and restore methods for use from a container's View.onSaveInstanceState and View.onRestoreInstanceState methods.
Also handles androidx SavedStateRegistryOwner duties, via a wrapped instance of WorkflowSavedStateRegistryAggregator. This means that container views using this class must call attachToParentRegistryOwner and detachFromParentRegistry when they are attached and detached, respectively.
Functions
Must be called whenever the owning view is attached to a window. Must eventually be matched with a call to detachFromParentRegistry.
Must be called whenever the owning view is detached from a window. Must be matched with a call to attachToParentRegistryOwner.
To be called when the set of hidden views changes but the visible view remains the same. Any cached view state held for renderings that are not compatible those in retaining will be dropped.
Replaces the state of the receiver with that of from. Typical usage is to call this from a container view's View.onRestoreInstanceState.
Returns a Parcelable copy of the internal state of the receiver, for use with a container view's View.onSaveInstanceState.