RecyclerView.AdapterDataObserver


public abstract class RecyclerView.AdapterDataObserver


Observer base class for watching changes to an Adapter. See registerAdapterDataObserver.

Summary

Public constructors

Public methods

void
void
onItemRangeChanged(int positionStart, int itemCount)
void
onItemRangeChanged(
    int positionStart,
    int itemCount,
    @Nullable Object payload
)
void
onItemRangeInserted(int positionStart, int itemCount)
void
onItemRangeMoved(int fromPosition, int toPosition, int itemCount)
void
onItemRangeRemoved(int positionStart, int itemCount)
void

Called when the Adapter.StateRestorationPolicy of the Adapter changed.

Public constructors

AdapterDataObserver

Added in 1.0.0
public AdapterDataObserver()

Public methods

onChanged

Added in 1.0.0
public void onChanged()

onItemRangeChanged

Added in 1.0.0
public void onItemRangeChanged(int positionStart, int itemCount)

onItemRangeChanged

Added in 1.0.0
public void onItemRangeChanged(
    int positionStart,
    int itemCount,
    @Nullable Object payload
)

onItemRangeInserted

Added in 1.0.0
public void onItemRangeInserted(int positionStart, int itemCount)

onItemRangeMoved

Added in 1.0.0
public void onItemRangeMoved(int fromPosition, int toPosition, int itemCount)

onItemRangeRemoved

Added in 1.0.0
public void onItemRangeRemoved(int positionStart, int itemCount)

onStateRestorationPolicyChanged

Added in 1.2.0
public void onStateRestorationPolicyChanged()

Called when the Adapter.StateRestorationPolicy of the Adapter changed. When this method is called, the Adapter might be ready to restore its state if it has not already been restored.