androidx.paging

Interfaces

PagedListListener

Listener for when the current PagedList is updated.

InvalidatedCallback

Classes

AdjacentItems

Represents a pair of adjacent items, null values are used to signal boundary conditions.

AsyncPagedListDiffer

Helper object for mapping a androidx.paging.PagedList into a RecyclerView.Adapter.

AsyncPagingDataDiffer

Helper class for mapping a PagingData into a RecyclerView.Adapter.

CombinedLoadStates

Collection of pagination LoadStates for both a PagingSource, and RemoteMediator.

DataSource

Base class for loading pages of snapshot data into a PagedList.

ItemKeyedDataSource

Incremental data loader for paging keyed content, where loaded content uses previously loaded items as input to future loads.

ItemSnapshotList

Snapshot of data being presented by a AsyncPagingDataDiffer or a PagingDataAdapter.

ListenableFuturePagingSource

ListenableFuture-based compatibility wrapper around PagingSource's suspending APIs.

ListenableFutureRemoteMediator

ListenableFuture-based compatibility wrapper around RemoteMediator's suspending APIs.

LivePagedListBuilder

Builder for LiveData<PagedList> for Java users, given a androidx.paging.DataSource.Factory and a androidx.paging.PagedList.Config.

LoadState

LoadState of a PagedList load - associated with a LoadType

LoadStateAdapter

Adapter for displaying a RecyclerView item based on LoadState, such as a loading spinner, or a retry error button.

LoadStates

Collection of pagination LoadStates - refresh, prepend, and append.

MutableLoadStateCollection

TODO: Remove this once PageEvent.LoadStateUpdate contained CombinedLoadStates.

PagedList

Lazy loading list that pages in immutable content from a PagingSource.

PagedListAdapter

RecyclerView.Adapter base class for presenting paged data from androidx.paging.PagedLists in a RecyclerView.

PageKeyedDataSource

Incremental data loader for page-keyed content, where requests return keys for next/previous pages.

Pager

Primary entry point into Paging; constructor for a reactive stream of PagingData.

PagingConfig

An object used to configure loading behavior within a Pager, as it loads content from a PagingSource.

PagingData

Container for Paged data from a single generation of loads.

PagingDataAdapter

RecyclerView.Adapter base class for presenting paged data from PagingDatas in a RecyclerView.

PagingSource

Base class for an abstraction of pageable static data from some source, where loading pages of data is typically an expensive operation.

PagingState

Snapshot state of Paging system including the loaded pages, the last accessed anchorPosition, and the config used.

PositionalDataSource

Position-based data loader for a fixed-size, countable data set, supporting fixed-size loads at arbitrary page positions.

RemoteMediator

Defines a set of callbacks, which may be optionally registered when constructing a Pager, that allow for control of the following events:

RxPagedListBuilder

Builder for Observable<PagedList> or Flowable<PagedList>, given a DataSource.Factory and a PagedList.Config.

Annotations

ExperimentalPagingApi

Marks experimental Paging APIs, which may have known issues that would likely be solved by a source-incompatible change in newer versions of the artifact that supplies it.

Enums

LoadType

Type of load a PagingData can trigger a PagingSource to perform.

Top-level functions summary

PagedList.Config
Config(pageSize: Int, prefetchDistance: Int = pageSize, enablePlaceholders: Boolean = true, initialLoadSizeHint: Int = pageSize * PagedList.Config.Builder.DEFAULT_INITIAL_PAGE_MULTIPLIER, maxSize: Int = PagedList.Config.MAX_SIZE_UNBOUNDED)

Constructs a PagedList.Config, convenience for PagedList.Config.Builder.

PagedList<Value>
PagedList(dataSource: DataSource<Key, Value>, config: PagedList.Config, notifyExecutor: Executor, fetchExecutor: Executor, boundaryCallback: PagedList.BoundaryCallback<Value>? = null, initialKey: Key? = null)

Constructs a PagedList, convenience for PagedList.Builder.

Extension functions summary

For kotlin.Function0
Flowable<PagedList<Value>>
() -> PagingSource<Key, Value>.toFlowable(config: PagedList.Config, initialLoadKey: Key? = null, boundaryCallback: PagedList.BoundaryCallback<Value>? = null, fetchScheduler: Scheduler? = null, notifyScheduler: Scheduler? = null, backpressureStrategy: BackpressureStrategy = BackpressureStrategy.LATEST)

Constructs a Flowable<PagedList>, from this PagingSource factory, convenience for RxPagedListBuilder.

Flowable<PagedList<Value>>
() -> PagingSource<Key, Value>.toFlowable(pageSize: Int, initialLoadKey: Key? = null, boundaryCallback: PagedList.BoundaryCallback<Value>? = null, fetchScheduler: Scheduler? = null, notifyScheduler: Scheduler? = null, backpressureStrategy: BackpressureStrategy = BackpressureStrategy.LATEST)

Constructs a Flowable<PagedList>, from this PagingSource factory, convenience for RxPagedListBuilder.

LiveData<PagedList<Value>>
() -> PagingSource<Key, Value>.toLiveData(config: PagedList.Config, initialLoadKey: Key? = null, boundaryCallback: PagedList.BoundaryCallback<Value>? = null, coroutineScope: CoroutineScope = GlobalScope, fetchDispatcher: CoroutineDispatcher = ArchTaskExecutor.getIOThreadExecutor() .asCoroutineDispatcher())

Constructs a LiveData<PagedList>, from this PagingSource factory, convenience for LivePagedListBuilder.

LiveData<PagedList<Value>>
() -> PagingSource<Key, Value>.toLiveData(pageSize: Int, initialLoadKey: Key? = null, boundaryCallback: PagedList.BoundaryCallback<Value>? = null, coroutineScope: CoroutineScope = GlobalScope, fetchDispatcher: CoroutineDispatcher = ArchTaskExecutor.getIOThreadExecutor() .asCoroutineDispatcher())

Constructs a LiveData<PagedList>, from this PagingSource factory, convenience for LivePagedListBuilder.

Observable<PagedList<Value>>
() -> PagingSource<Key, Value>.toObservable(config: PagedList.Config, initialLoadKey: Key? = null, boundaryCallback: PagedList.BoundaryCallback<Value>? = null, fetchScheduler: Scheduler? = null, notifyScheduler: Scheduler? = null)

Constructs a Observable<PagedList> from this PagingSource factory, convenience for RxPagedListBuilder.

Observable<PagedList<Value>>
() -> PagingSource<Key, Value>.toObservable(pageSize: Int, initialLoadKey: Key? = null, boundaryCallback: PagedList.BoundaryCallback<Value>? = null, fetchScheduler: Scheduler? = null, notifyScheduler: Scheduler? = null)

Constructs a Observable<PagedList> from this PagingSource factory, convenience for RxPagedListBuilder.

For kotlinx.coroutines.flow.Flow
Flow<PagingData<T>>

Caches the PagingData such that any downstream collection from this flow will share the same PagingData.

For LiveData
LiveData<PagingData<T>>

Operator which caches a LiveData of PagingData within the scope of a Lifecycle.

LiveData<PagingData<T>>

Operator which caches a LiveData of PagingData within a CoroutineScope.

For PagingData
PagingData<T>
PagingData<T>.filter(predicate: suspend (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>.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<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>

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>.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.

For Factory
Flowable<PagedList<Value>>
DataSource.Factory<Key, Value>.toFlowable(config: PagedList.Config, initialLoadKey: Key? = null, boundaryCallback: PagedList.BoundaryCallback<Value>? = null, fetchScheduler: Scheduler? = null, notifyScheduler: Scheduler? = null, backpressureStrategy: BackpressureStrategy = BackpressureStrategy.LATEST)

Constructs a Flowable<PagedList>, from this DataSource.Factory, convenience for RxPagedListBuilder.

Flowable<PagedList<Value>>
DataSource.Factory<Key, Value>.toFlowable(pageSize: Int, initialLoadKey: Key? = null, boundaryCallback: PagedList.BoundaryCallback<Value>? = null, fetchScheduler: Scheduler? = null, notifyScheduler: Scheduler? = null, backpressureStrategy: BackpressureStrategy = BackpressureStrategy.LATEST)

Constructs a Flowable<PagedList>, from this DataSource.Factory, convenience for RxPagedListBuilder.

LiveData<PagedList<Value>>
DataSource.Factory<Key, Value>.toLiveData(config: PagedList.Config, initialLoadKey: Key? = null, boundaryCallback: PagedList.BoundaryCallback<Value>? = null, fetchExecutor: Executor = ArchTaskExecutor.getIOThreadExecutor())

Constructs a LiveData<PagedList>, from this DataSource.Factory, convenience for LivePagedListBuilder.

LiveData<PagedList<Value>>
DataSource.Factory<Key, Value>.toLiveData(pageSize: Int, initialLoadKey: Key? = null, boundaryCallback: PagedList.BoundaryCallback<Value>? = null, fetchExecutor: Executor = ArchTaskExecutor.getIOThreadExecutor())

Constructs a LiveData<PagedList>, from this DataSource.Factory, convenience for LivePagedListBuilder.

Observable<PagedList<Value>>
DataSource.Factory<Key, Value>.toObservable(config: PagedList.Config, initialLoadKey: Key? = null, boundaryCallback: PagedList.BoundaryCallback<Value>? = null, fetchScheduler: Scheduler? = null, notifyScheduler: Scheduler? = null)

Constructs a Observable<PagedList> from this DataSource.Factory, convenience for RxPagedListBuilder.

Observable<PagedList<Value>>
DataSource.Factory<Key, Value>.toObservable(pageSize: Int, initialLoadKey: Key? = null, boundaryCallback: PagedList.BoundaryCallback<Value>? = null, fetchScheduler: Scheduler? = null, notifyScheduler: Scheduler? = null)

Constructs a Observable<PagedList> from this DataSource.Factory, convenience for RxPagedListBuilder.

Extension properties summary

For Pager
LiveData<PagingData<Value>>
Pager<Key, Value>.liveData()

A LiveData of PagingData, which mirrors the stream provided by Pa