added in version 27.1.0
belongs to Maven artifact com.android.support:recyclerview-v7:28.0.0-alpha1

AdapterListUpdateCallback

public final class AdapterListUpdateCallback
extends Object implements ListUpdateCallback

java.lang.Object
   ↳ android.support.v7.util.AdapterListUpdateCallback


ListUpdateCallback that dispatches update events to the given adapter.

Summary

Public constructors

AdapterListUpdateCallback(Adapter adapter)

Creates an AdapterListUpdateCallback that will dispatch update events to the given adapter.

Public methods

void onChanged(int position, int count, Object payload)

Called when count number of items are updated at the given position.

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

From class java.lang.Object
From interface android.support.v7.util.ListUpdateCallback

Public constructors

AdapterListUpdateCallback

added in version 27.1.0
AdapterListUpdateCallback (Adapter adapter)

Creates an AdapterListUpdateCallback that will dispatch update events to the given adapter.

Parameters
adapter Adapter: The Adapter to send updates to.

Public methods

onChanged

added in version 27.1.0
void onChanged (int position, 
                int count, 
                Object payload)

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.

payload Object

onInserted

added in version 27.1.0
void onInserted (int position, 
                int count)

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

added in version 27.1.0
void onMoved (int fromPosition, 
                int toPosition)

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.

onRemoved

added in version 27.1.0
void onRemoved (int position, 
                int count)

Called when count number of items are removed from the given position.

Parameters
position int: The position of the item which has been removed.

count int: The number of items which have been removed.