belongs to Maven artifact com.android.support:recyclerview-v7:28.0.0-alpha1
BatchingListUpdateCallback
public
class
BatchingListUpdateCallback
extends Object
implements
ListUpdateCallback
java.lang.Object | |
↳ | android.support.v7.util.BatchingListUpdateCallback |
Wraps a ListUpdateCallback
callback and batches operations that can be merged.
For instance, when 2 add operations comes that adds 2 consecutive elements, BatchingListUpdateCallback merges them and calls the wrapped callback only once.
This is a general purpose class and is also used by
DiffResult
and
SortedList
to minimize the number of updates that are dispatched.
If you use this class to batch updates, you must call dispatchLastEvent()
when the
stream of update events drain.
Summary
Public constructors | |
---|---|
BatchingListUpdateCallback(ListUpdateCallback callback)
|
Public methods | |
---|---|
void
|
dispatchLastEvent()
BatchingListUpdateCallback holds onto the last event to see if it can be merged with the next one. |
void
|
onChanged(int position, int count, Object payload)
Called when |
void
|
onInserted(int position, int count)
Called when |
void
|
onMoved(int fromPosition, int toPosition)
Called when an item changes its position in the list. |
void
|
onRemoved(int position, int count)
Called when |
Inherited methods | |
---|---|
![]()
java.lang.Object
| |
![]()
android.support.v7.util.ListUpdateCallback
|