public interface ListUpdateCallback
This class can be used together with DiffUtil to detect changes between two lists.
Modifier and Type | Method and Description |
---|---|
void |
onChanged(int position,
int count,
Object payload)
Called when
count number of items are updated at the given position. |
void |
onInserted(int position,
int count)
Called when
count number of items are inserted at the given position. |
void |
onMoved(int fromPosition,
int toPosition)
Called when an item changes its position in the list.
|
void |
onRemoved(int position,
int count)
Called when
count number of items are removed from the given position. |
void onInserted(int position, int count)
count
number of items are inserted at the given position.position
- The position of the new item.count
- The number of items that have been added.void onRemoved(int position, int count)
count
number of items are removed from the given position.position
- The position of the item which has been removed.count
- The number of items which have been removed.void onMoved(int fromPosition, int toPosition)
fromPosition
- The previous position of the item before the move.toPosition
- The new position of the item.void onChanged(int position, int count, Object payload)
count
number of items are updated at the given position.position
- The position of the item which has been updated.count
- The number of items which has changed.