Google is committed to advancing racial equity for Black communities. See how.

PagingData

class PagingData<T : Any>
kotlin.Any
   ↳ androidx.paging.PagingData

Container for Paged data from a single generation of loads.

Each refresh of data (generally either pushed by local storage, or pulled from the network) will have a separate corresponding PagingData.

Summary

Companion functions
PagingData<T>

Create a PagingData that immediately displays an empty list of items when submitted to AsyncPagingDataAdapter.

PagingData<T>
from(data: List<T>)

Create a PagingData that immediately displays a static list of items when submitted to AsyncPagingDataAdapter.

Extension functions
From androidx.paging
PagingData<T>
PagingData<T>.filter(predicate: suspend (T) -> Boolean)

Returns a PagingData containing only elements matching the given predicate

PagingData<T>
PagingData<T>.filter(executor: Executor, predicate: (T) -> Boolean)

Returns a PagingData containing only elements matching the given predicate.

PagingData<T>
PagingData<T>.filterAsync(predicate: AsyncFunction<T, Boolean>, executor: Executor)

Returns a PagingData containing only elements matching the given predicate.

PagingData<R>
PagingData<T>.flatMap(transform: suspend (T) -> Iterable<R>)

Returns a PagingData of all elements returned from applying the given transform to each element, as it is loaded.

PagingData<R>
PagingData<T>.flatMap(executor: Executor, transform: (T) -> Iterable<R>)

Returns a PagingData of all elements returned from applying the given transform to each element, as it is loaded.

PagingData<R>
PagingData<T>.flatMapAsync(transform: AsyncFunction<T, Iterable<R>>, executor: Executor)

Returns a PagingData of all elements returned from applying the given transform to each element, as it is loaded.

PagingData<T>

Returns a PagingData containing each original element, with the passed footer item added to the end of the list.

PagingData<T>

Returns a PagingData containing each original element, with the passed header item added to the start of the list.

PagingData<R>
PagingData<T>.insertSeparators(generator: suspend (T?, T?) -> R?)

Returns a PagingData containing each original element, with an optional separator generated by generator, given the elements before and after (or null, in boundary conditions).

PagingData<R>
PagingData<T>.insertSeparators(executor: Executor, generator: (T?, T?) -> R?)

Returns a PagingData containing each original element, with an optional separator generated by generator, given the elements before and after (or null, in boundary conditions).

PagingData<R>

Returns a PagingData containing each original element, with an optional separator generated by generator, given the elements before and after (or null, in boundary conditions).

PagingData<R>
PagingData<T>.map(transform: suspend (T) -> R)

Returns a PagingData containing the result of applying the given transform to each element, as it is loaded.

PagingData<R>
PagingData<T>.map(executor: Executor, transform: (T) -> R)

Returns a PagingData containing the result of applying the given transform to each element, as it is loaded.

PagingData<R>
PagingData<T>.mapAsync(transform: AsyncFunction<T, R>, executor: Executor)

Returns a PagingData containing the result of applying the given transform to each element, as it is loaded.

From androidx.paging.rxjava2
PagingData<T>
PagingData<T>.filterAsync(predicate: (T) -> Single<Boolean>)

Returns a PagingData containing only elements matching the given predicate.

PagingData<R>
PagingData<T>.flatMapAsync(transform: (T) -> Single<Iterable<R>>)

Returns a PagingData of all elements returned from applying the given transform to each element, as it is loaded.

PagingData<R>
PagingData<T>.insertSeparatorsAsync(generator: (T?, T?) -> Maybe<R>)

Returns a PagingData containing each original element, with an optional separator generated by generator, given the elements before and after (or null, in boundary conditions).

PagingData<R>
PagingData<T>.mapAsync(transform: (T) -> Single<R>)

Returns a PagingData containing the result of applying the given transform to each element, as it is loaded.

From androidx.paging.rxjava3
PagingData<T>
PagingData<T>.filterAsync(predicate: (T) -> Single<Boolean>)

Returns a PagingData containing only elements matching the given predicate.

PagingData<R>
PagingData<T>.flatMapAsync(transform: (T) -> Single<Iterable<R>>)

Returns a PagingData of all elements returned from applying the given transform to each element, as it is loaded.

PagingData<R>
PagingData<T>.insertSeparatorsAsync(generator: (T?, T?) -> Maybe<R>)

Returns a PagingData containing each original element, with an optional separator generated by generator, given the elements