AdapterListUpdateCallback
class AdapterListUpdateCallback : ListUpdateCallback
kotlin.Any | |
↳ | androidx.recyclerview.widget.AdapterListUpdateCallback |
ListUpdateCallback that dispatches update events to the given adapter.
Summary
Public constructors | |
---|---|
<init>(@NonNull adapter: RecyclerView.Adapter<RecyclerView.ViewHolder!>) Creates an AdapterListUpdateCallback that will dispatch update events to the given adapter. |
Public methods | |
---|---|
Unit |
Called when |
Unit |
onInserted(position: Int, count: Int) Called when |
Unit |
Called when an item changes its position in the list. |
Unit |
Called when |
Public constructors
<init>
AdapterListUpdateCallback(@NonNull adapter: RecyclerView.Adapter<RecyclerView.ViewHolder!>)
Creates an AdapterListUpdateCallback that will dispatch update events to the given adapter.
Parameters | |
---|---|
adapter |
RecyclerView.Adapter<RecyclerView.ViewHolder!>: The Adapter to send updates to. |
Public methods
onChanged
fun onChanged(
position: Int,
count: Int,
payload: Any?
): Unit
Called when count
number of items are updated at the given position.
Parameters | |
---|---|
position |
Int: The position of the item which has been updated. |
count |
Int: The number of items which has changed. |
onInserted
fun onInserted(
position: Int,
count: Int
): Unit
Called when count
number of items are inserted at the given position.
Parameters | |
---|---|
position |
Int: The position of the new item. |
count |
Int: The number of items that have been added. |
onMoved
fun onMoved(
fromPosition: Int,
toPosition: Int
): Unit
Called when an item changes its position in the list.
Parameters | |
---|---|
fromPosition |
Int: The previous position of the item before the move. |
toPosition |
Int: The new position of the item. |