RecyclerView.AdapterDataObserver


abstract class RecyclerView.AdapterDataObserver


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

Summary

Public constructors

Public functions

Unit
Unit
onItemRangeChanged(positionStart: Int, itemCount: Int)
Unit
onItemRangeChanged(positionStart: Int, itemCount: Int, payload: Any?)
Unit
onItemRangeInserted(positionStart: Int, itemCount: Int)
Unit
onItemRangeMoved(fromPosition: Int, toPosition: Int, itemCount: Int)
Unit
onItemRangeRemoved(positionStart: Int, itemCount: Int)
Unit

Called when the Adapter.StateRestorationPolicy of the Adapter changed.

Public constructors

AdapterDataObserver

Added in 1.0.0
AdapterDataObserver()

Public functions

onChanged

Added in 1.0.0
fun onChanged(): Unit

onItemRangeChanged

Added in 1.0.0
fun onItemRangeChanged(positionStart: Int, itemCount: Int): Unit

onItemRangeChanged

Added in 1.0.0
fun onItemRangeChanged(positionStart: Int, itemCount: Int, payload: Any?): Unit

onItemRangeInserted

Added in 1.0.0
fun onItemRangeInserted(positionStart: Int, itemCount: Int): Unit

onItemRangeMoved

Added in 1.0.0
fun onItemRangeMoved(fromPosition: Int, toPosition: Int, itemCount: Int): Unit

onItemRangeRemoved

Added in 1.0.0
fun onItemRangeRemoved(positionStart: Int, itemCount: Int): Unit

onStateRestorationPolicyChanged

Added in 1.2.0
fun onStateRestorationPolicyChanged(): Unit

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.