Participe do evento ⁠#Android11: apresentação de lançamento da versão Beta no dia 3 de junho.

AdapterDataObserver

abstract class AdapterDataObserver
kotlin.Any
   ↳ androidx.recyclerview.widget.RecyclerView.AdapterDataObserver

Observer base class for watching changes to an Adapter. See Adapter#registerAdapterDataObserver(AdapterDataObserver).

Summary

Public constructors

Observer base class for watching changes to an Adapter.

Public methods

open Unit

open Unit
onItemRangeChanged(positionStart: Int, itemCount: Int)

open Unit
onItemRangeChanged(positionStart: Int, itemCount: Int, @Nullable payload: Any?)

open Unit
onItemRangeInserted(positionStart: Int, itemCount: Int)

open Unit
onItemRangeMoved(fromPosition: Int, toPosition: Int, itemCount: Int)

open Unit
onItemRangeRemoved(positionStart: Int, itemCount: Int)

open Unit

Called when the Adapter.StateRestorationPolicy of the Adapter changed.

Public constructors

<init>

AdapterDataObserver()

Observer base class for watching changes to an Adapter. See Adapter#registerAdapterDataObserver(AdapterDataObserver).

Public methods

onChanged

open fun onChanged(): Unit

onItemRangeChanged

open fun onItemRangeChanged(
    positionStart: Int,
    itemCount: Int
): Unit

onItemRangeChanged

open fun onItemRangeChanged(
    positionStart: Int,
    itemCount: Int,
    @Nullable payload: Any?
): Unit

onItemRangeInserted

open fun onItemRangeInserted(
    positionStart: Int,
    itemCount: Int
): Unit

onItemRangeMoved

open fun onItemRangeMoved(
    fromPosition: Int,
    toPosition: Int,
    itemCount: Int
): Unit

onItemRangeRemoved

open fun onItemRangeRemoved(
    positionStart: Int,
    itemCount: Int
): Unit

onStateRestorationPolicyChanged

open 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.