ViewStateCache

@WorkflowUiExperimentalApi()
class ViewStateCache : Parcelable

Handles persistence chores for container views that manage a set of Named renderings, showing a view for one at a time -- think back stacks or tab sets.

This class implements Parcelable so that it can be preserved from a container view's own View.saveHierarchyState method. A simple container can return SavedState from that method rather than creating its own persistence class.

Constructors

ViewStateCache
Link copied to clipboard
fun ViewStateCache()

Types

CREATOR
Link copied to clipboard
object CREATOR : Parcelable.Creator<ViewStateCache>
SavedState
Link copied to clipboard
class SavedState : View.BaseSavedState
Convenience for use in View.onSaveInstanceState and View.onRestoreInstanceState methods of container views that have no other state of their own to save.

Functions

describeContents
Link copied to clipboard
open override fun describeContents(): Int
prune
Link copied to clipboard
fun prune(retaining: Collection<Named<*>>)
To be called when the set of hidden views changes but the visible view remains the same.
restore
Link copied to clipboard
fun restore(from: ViewStateCache)
Replaces the state of the receiver with that of from.
update
Link copied to clipboard
fun update(retainedRenderings: Collection<Named<*>>, oldViewMaybe: View?, newView: View)
writeToParcel
Link copied to clipboard
open override fun writeToParcel(parcel: Parcel, flags: Int)