StateRestorationPolicy
class StateRestorationPolicy
kotlin.Any | ||
↳ | kotlin.Enum<androidx.recyclerview.widget.RecyclerView.Adapter.StateRestorationPolicy> | |
↳ | androidx.recyclerview.widget.RecyclerView.Adapter.StateRestorationPolicy |
Defines how this Adapter wants to restore its state after a view reconstruction (e.g. configuration change).
Summary
Enum values | |
---|---|
Adapter is ready to restore State immediately, RecyclerView will provide the state to the LayoutManager in the next layout pass. |
|
RecyclerView will not restore the state for the Adapter until a call to |
|
Adapter is ready to restore State when it has more than 0 items. |
Enum values
ALLOW
enum val ALLOW : RecyclerView.Adapter.StateRestorationPolicy
Adapter is ready to restore State immediately, RecyclerView will provide the state to the LayoutManager in the next layout pass.
PREVENT
enum val PREVENT : RecyclerView.Adapter.StateRestorationPolicy
RecyclerView will not restore the state for the Adapter until a call to setStateRestorationPolicy(StateRestorationPolicy)
is made with either ALLOW
or PREVENT_WHEN_EMPTY
.
PREVENT_WHEN_EMPTY
enum val PREVENT_WHEN_EMPTY : RecyclerView.Adapter.StateRestorationPolicy
Adapter is ready to restore State when it has more than 0 items. RecyclerView will provide the state to the LayoutManager as soon as the Adapter has 1 or more items.