ObjectAdapter.DataObserver
public abstract class ObjectAdapter.DataObserver
A DataObserver can be notified when an ObjectAdapter's underlying data changes. Separate methods provide notifications about different types of changes.
Summary
Public constructors |
|---|
Public methods |
|
|---|---|
void |
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. |
void |
onItemMoved(int fromPosition, int toPosition)Called when an item is moved from one position to another position |
void |
onItemRangeChanged(int positionStart, int itemCount)Called when a range of items in the ObjectAdapter has changed. |
void |
onItemRangeChanged(Called when a range of items in the ObjectAdapter has changed. |
void |
onItemRangeInserted(int positionStart, int itemCount)Called when a range of items is inserted into the ObjectAdapter. |
void |
onItemRangeRemoved(int positionStart, int itemCount)Called when a range of items is removed from the ObjectAdapter. |
Public constructors
Public methods
onChanged
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.
onItemMoved
public void onItemMoved(int fromPosition, int toPosition)
Called when an item is moved from one position to another position
| Parameters | |
|---|---|
int fromPosition |
Previous position of the item. |
int toPosition |
New position of the item. |
onItemRangeChanged
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 | |
|---|---|
int positionStart |
The position of the first item that changed. |
int itemCount |
The number of items changed. |
onItemRangeChanged
public void onItemRangeChanged(
int positionStart,
int itemCount,
@Nullable Object payload
)
Called when a range of items in the ObjectAdapter has changed. The basic ordering and structure of the ObjectAdapter has not changed.
onItemRangeInserted
public void onItemRangeInserted(int positionStart, int itemCount)
Called when a range of items is inserted into the ObjectAdapter.
| Parameters | |
|---|---|
int positionStart |
The position of the first inserted item. |
int itemCount |
The number of items inserted. |
onItemRangeRemoved
public void onItemRangeRemoved(int positionStart, int itemCount)
Called when a range of items is removed from the ObjectAdapter.
| Parameters | |
|---|---|
int positionStart |
The position of the first removed item. |
int itemCount |
The number of items removed. |