public abstract class

PagedList.Callback

extends java.lang.Object

 java.lang.Object

↳androidx.paging.PagedList.Callback

Overview

Callback signaling when content is loaded into the list.

Can be used to listen to items being paged in and out. These calls will be dispatched on the executor defined by PagedList.Builder.setNotifyExecutor(Executor), which is generally the main/UI thread.

Summary

Constructors
publicCallback()

Methods
public abstract voidonChanged(int position, int count)

Called when null padding items have been loaded to signal newly available data, or when data that hasn't been used in a while has been dropped, and swapped back to null.

public abstract voidonInserted(int position, int count)

Called when new items have been loaded at the end or beginning of the list.

public abstract voidonRemoved(int position, int count)

Called when items have been removed at the end or beginning of the list, and have not been replaced by padded nulls.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Callback()

Methods

public abstract void onChanged(int position, int count)

Called when null padding items have been loaded to signal newly available data, or when data that hasn't been used in a while has been dropped, and swapped back to null.

Parameters:

position: Position of first newly loaded items, out of total number of items (including padded nulls).
count: Number of items loaded.

public abstract void onInserted(int position, int count)

Called when new items have been loaded at the end or beginning of the list.

Parameters:

position: Position of the first newly loaded item (in practice, either 0 or size - 1.
count: Number of items loaded.

public abstract void onRemoved(int position, int count)

Called when items have been removed at the end or beginning of the list, and have not been replaced by padded nulls.

Parameters:

position: Position of the first newly loaded item (in practice, either 0 or size - 1.
count: Number of items loaded.