-
public interface ListUpdateCallback
An interface that can receive Update operations that are applied to a list.
This class can be used together with DiffUtil to detect changes between two lists.
-
-
Method Summary
Modifier and Type Method Description abstract void
onInserted(int position, int count)
Called when {@code count}
number of items are inserted at the given position.abstract void
onRemoved(int position, int count)
Called when {@code count}
number of items are removed from the given position.abstract void
onMoved(int fromPosition, int toPosition)
Called when an item changes its position in the list. abstract void
onChanged(int position, int count, @Nullable() Object payload)
Called when {@code count}
number of items are updated at the given position.-
-
Method Detail
-
onInserted
abstract void onInserted(int position, int count)
Called when
{@code count}
number of items are inserted at the given position.- Parameters:
position
- The position of the new item.count
- The number of items that have been added.
-
onRemoved
abstract void onRemoved(int position, int count)
Called when
{@code count}
number of items are removed from the given position.- Parameters:
position
- The position of the item which has been removed.count
- The number of items which have been removed.
-
onMoved
abstract void onMoved(int fromPosition, int toPosition)
Called when an item changes its position in the list.
- Parameters:
fromPosition
- The previous position of the item before the move.toPosition
- The new position of the item.
-
-
-
-