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.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard

Functions

Link copied to clipboard

Must be called whenever the owning view is attached to a window. Must eventually be matched with a call to detachFromParentRegistry.

Link copied to clipboard

Must be called whenever the owning view is detached from a window. Must be matched with a call to attachToParentRegistryOwner.

Link copied to clipboard
fun prune(retaining: Collection<NamedScreen<*>>)

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.

Link copied to clipboard

Replaces the state of the receiver with that of from. Typical usage is to call this from a container view's View.onRestoreInstanceState.

Link copied to clipboard

Returns a Parcelable copy of the internal state of the receiver, for use with a container view's View.onSaveInstanceState.

Link copied to clipboard
fun update(retainedRenderings: Collection<NamedScreen<*>>, oldHolderMaybe: ScreenViewHolder<NamedScreen<*>>?, newHolder: ScreenViewHolder<NamedScreen<*>>)