public abstract class

ObjectAdapter.DataObserver

extends java.lang.Object

 java.lang.Object

↳androidx.leanback.widget.ObjectAdapter.DataObserver

Overview

A DataObserver can be notified when an ObjectAdapter's underlying data changes. Separate methods provide notifications about different types of changes.

Summary

Constructors
publicDataObserver()

Methods
public voidonChanged()

Called whenever the ObjectAdapter's data has changed in some manner outside of the set of changes covered by the other range-based change notification methods.

public voidonItemMoved(int fromPosition, int toPosition)

Called when an item is moved from one position to another position

public voidonItemRangeChanged(int positionStart, int itemCount)

Called when a range of items in the ObjectAdapter has changed.

public voidonItemRangeChanged(int positionStart, int itemCount, java.lang.Object payload)

Called when a range of items in the ObjectAdapter has changed.

public voidonItemRangeInserted(int positionStart, int itemCount)

Called when a range of items is inserted into the ObjectAdapter.

public voidonItemRangeRemoved(int positionStart, int itemCount)

Called when a range of items is removed from the ObjectAdapter.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public DataObserver()

Methods

public void onChanged()

Called whenever the ObjectAdapter's data has changed in some manner outside of the set of changes covered by the other range-based change notification methods.

public void onItemRangeChanged(int positionStart, int itemCount)

Called when a range of items in the ObjectAdapter has changed. The basic ordering and structure of the ObjectAdapter has not changed.

Parameters:

positionStart: The position of the first item that changed.
itemCount: The number of items changed.

public void onItemRangeChanged(int positionStart, int itemCount, java.lang.Object payload)

Called when a range of items in the ObjectAdapter has changed. The basic ordering and structure of the ObjectAdapter has not changed.

Parameters:

positionStart: The position of the first item that changed.
itemCount: The number of items changed.
payload: Optional parameter, use null to identify a "full" update.

public void onItemRangeInserted(int positionStart, int itemCount)

Called when a range of items is inserted into the ObjectAdapter.

Parameters:

positionStart: The position of the first inserted item.
itemCount: The number of items inserted.

public void onItemMoved(int fromPosition, int toPosition)

Called when an item is moved from one position to another position

Parameters:

fromPosition: Previous position of the item.
toPosition: New position of the item.

public void onItemRangeRemoved(int positionStart, int itemCount)

Called when a range of items is removed from the ObjectAdapter.

Parameters:

positionStart: The position of the first removed item.
itemCount: The number of items removed.