public abstract class SortedListAdapterCallback<T2> extends SortedList.Callback<T2>
Constructor and Description |
---|
SortedListAdapterCallback(RecyclerView.Adapter adapter)
Creates a
SortedList.Callback that will forward data change events to the provided
Adapter. |
Modifier and Type | Method and Description |
---|---|
void |
onChanged(int position,
int count)
Called by the SortedList when the item at the given position is updated.
|
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. |
areContentsTheSame, areItemsTheSame, compare, onChanged
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public SortedListAdapterCallback(RecyclerView.Adapter adapter)
SortedList.Callback
that will forward data change events to the provided
Adapter.adapter
- The Adapter instance which should receive events from the SortedList.public void onInserted(int position, int count)
ListUpdateCallback
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.public void onRemoved(int position, int count)
ListUpdateCallback
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.public void onMoved(int fromPosition, int toPosition)
ListUpdateCallback
fromPosition
- The previous position of the item before the move.toPosition
- The new position of the item.public void onChanged(int position, int count)
SortedList.Callback
onChanged
in class SortedList.Callback<T2>
position
- The position of the item which has been updated.count
- The number of items which has changed.