ViewStatePagerAdapter

A simple implementation of PagerAdapter that automatically saves and restores view states when returning to pages previously removed and after view pager's state restoration. Similar to FragmentStatePagerAdapter but for use with just view, rather than fragments.

Inheritors

Functions

Link copied to clipboard
fun destroyItem(container: ViewGroup, position: Int, object: Any)
Removes a page for the given position from the container, saving its view state for later restoration.
Link copied to clipboard
fun instantiateItem(container: ViewGroup, position: Int): Any
Creates the page for the given position, restores any previously saved view state, and adds it to the container.
Link copied to clipboard
fun isViewFromObject(view: View, object: Any): Boolean
Determines whether a page View is associated with a specific key object as returned by instantiateItem.
Link copied to clipboard
fun restoreState(state: Parcelable, loader: ClassLoader)
Restores the adapter state that was previously saved via saveState.
Link copied to clipboard
fun saveState(): ViewStatePagerAdapter.SavedState
Saves the current state of the adapter.