SortedListAdapterCallback
public abstract class SortedListAdapterCallback<T2> extends SortedList.Callback
| java.lang.Object | ||
| ↳ | androidx.recyclerview.widget.SortedList.Callback | |
| ↳ | androidx.recyclerview.widget.SortedListAdapterCallback |
A SortedList.Callback implementation that can bind a SortedList to a RecyclerView.Adapter.
Summary
Public constructors |
|---|
|
Creates a |
Public methods |
|
|---|---|
void |
onChanged(int position, int count)Called by the SortedList when the item at the given position is updated. |
void |
|
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. |
Inherited methods |
||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||||||||||||||||
|
Public constructors
SortedListAdapterCallback
public SortedListAdapterCallback(RecyclerView.Adapter<Object> adapter)
Creates a SortedList.Callback that will forward data change events to the provided Adapter.
| Parameters | |
|---|---|
RecyclerView.Adapter<Object> adapter |
The Adapter instance which should receive events from the SortedList. |
Public methods
onChanged
public void onChanged(int position, int count)
Called by the SortedList when the item at the given position is updated.
onInserted
public void onInserted(int position, int count)
Called when count} number of items are inserted at the given position.