Google は、黒人コミュニティに対する人種平等の促進に取り組んでいます。取り組みを見る

androidx.paging

Interfaces

PagedListListener

Listener for when the current PagedList is updated.

InvalidatedCallback

Invalidation callback for DataSource.

Classes

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.

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<R>
PagingData<T>.insertSeparators(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).

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 Pager.flow, but exposes it as a LiveData.

Top-level functions

Config

fun 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
): PagedList.Config

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

Parameters
pageSize: Int Number of items loaded at once from the DataSource.
prefetchDistance: Int = pageSize Distance the PagedList should prefetch.
enablePlaceholders: Boolean = true False if null placeholders should be disabled.
initialLoadSizeHint: Int = pageSize * PagedList.Config.Builder.DEFAULT_INITIAL_PAGE_MULTIPLIER Number of items to load while initializing the PagedList.
maxSize: Int = PagedList.Config.MAX_SIZE_UNBOUNDED Maximum number of items to keep in memory, or PagedList.Config.MAX_SIZE_UNBOUNDED to disable page dropping.

PagedList

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

Deprecated.

Constructs a PagedList, convenience for PagedList.Builder.

Parameters
Key Type of key used to load data from the DataSource.
Value Type of items held and loaded by the PagedList.
dataSource: DataSource<Key, Value> DataSource the PagedList will load from.
config: PagedList.Config Config that defines how the PagedList loads data from its DataSource.
notifyExecutor: Executor Executor that receives PagedList updates, and where PagedList.Callback calls are dispatched. Generally, this is the UI/main thread.
fetchExecutor: Executor Executor used to fetch from DataSources, generally a background thread pool for e.g. I/O or network loading.
boundaryCallback: PagedList.BoundaryCallback<Value>? = null PagedList.BoundaryCallback for listening to out-of-data events.
initialKey: Key? = null Key the DataSource should load around as part of initialization.

Extension functions

cachedIn

@CheckResult fun <T : Any> Flow<PagingData<T>>.cachedIn(scope: CoroutineScope): Flow<PagingData<T>>

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

The flow is kept active as long as the given scope is active. To avoid leaks, make sure to use a scope that is already managed (like a ViewModel scope) or manually cancel it when you don't need paging anymore.

A common use case for this caching is to cache PagingData in a ViewModel. This can ensure that, upon configuration change (e.g. rotation), then new Activity will receive the existing data immediately rather than fetching it from scratch.

Note that this does not turn the Flow<PagingData> into a hot stream. It won't execute any unnecessary code unless it is being collected.


//Unresolved: androidx.paging.samples.cachedInSample
Parameters
scope: CoroutineScope The coroutine scope where this page cache will be kept alive.

cachedIn

fun <T : Any> LiveData<PagingData<T>>.cachedIn(lifecycle: Lifecycle): LiveData<PagingData<T>>

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

Parameters
lifecycle: Lifecycle The Lifecycle where the page cache will be kept alive.

cachedIn

fun <T : Any> LiveData<PagingData<T>>.cachedIn(scope: CoroutineScope): LiveData<PagingData<T>>

Operator which caches a LiveData of PagingData within a CoroutineScope.

Parameters
scope: CoroutineScope The CoroutineScope where the page cache will be kept alive. Typically this would be a managed scope such as ViewModel.viewModelScope, which automatically cancels after the PagingData stream is no longer needed. Otherwise, the provided CoroutineScope must be manually cancelled to avoid memory leaks.

insertSeparators

@CheckResult fun <T : R, R : Any> PagingData<T>.insertSeparators(generator: (T?, T?) -> R?): 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).

Note that this transform is applied asynchronously, as pages are loaded. Potential separators between pages are only computed once both pages are loaded.

Java callers should instead use the static function PagingData.insertSeparators


//Unresolved: androidx.paging.samples.insertSeparatorsSample

//Unresolved: androidx.paging.samples.insertSeparatorsUiModelSample

toFlowable

fun <Key : Any, Value : Any> (() -> 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
): Flowable<PagedList<Value>>

Deprecated.

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

The returned Flowable will already be subscribed on the fetchScheduler, and will perform all loading on that scheduler. It will already be observed on notifyScheduler, and will dispatch new PagedLists, as well as their updates to that scheduler.

Parameters
config: PagedList.Config Paging configuration.
initialLoadKey: Key? = null Initial load key passed to the first PagedList / PagingSource.
boundaryCallback: PagedList.BoundaryCallback<Value>? = null The boundary callback for listening to PagedList load state.
notifyScheduler: Scheduler? = null Scheduler that receives PagedList updates, and where PagedList.Callback calls are dispatched. Generally, this is the UI / main thread.
fetchScheduler: Scheduler? = null Scheduler used to fetch from PagingSources, generally a background thread pool for e.g. I/O or network loading.
backpressureStrategy: BackpressureStrategy = BackpressureStrategy.LATEST BackpressureStrategy for the Flowable to use.

toFlowable

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

Deprecated.

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

The returned Flowable will already be subscribed on the fetchScheduler, and will perform all loading on that scheduler. It will already be observed on notifyScheduler, and will dispatch new PagedLists, as well as their updates to that scheduler.

Parameters
pageSize: Int Page size.
initialLoadKey: Key? = null Initial load key passed to the first PagedList / PagingSource.
boundaryCallback: PagedList.BoundaryCallback<Value>? = null The boundary callback for listening to PagedList load state.
notifyScheduler: Scheduler? = null Scheduler that receives PagedList updates, and where PagedList.Callback calls are dispatched. Generally, this is the UI / main thread.
fetchScheduler: Scheduler? = null Scheduler used to fetch from PagingSources, generally a background thread pool for e.g. I/O or network loading.
backpressureStrategy: BackpressureStrategy = BackpressureStrategy.LATEST BackpressureStrategy for the Flowable to use.

toFlowable

fun <Key : Any, Value : Any> 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
): Flowable<PagedList<Value>>

Deprecated.

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

The returned Flowable will already be subscribed on the fetchScheduler, and will perform all loading on that scheduler. It will already be observed on notifyScheduler, and will dispatch new PagedLists, as well as their updates to that scheduler.

Parameters
config: PagedList.Config Paging configuration.
initialLoadKey: Key? = null Initial load key passed to the first PagedList / DataSource.
boundaryCallback: PagedList.BoundaryCallback<Value>? = null The boundary callback for listening to PagedList load state.
notifyScheduler: Scheduler? = null Scheduler that receives PagedList updates, and where PagedList.Callback calls are dispatched. Generally, this is the UI / main thread.
fetchScheduler: Scheduler? = null Scheduler used to fetch from DataSources, generally a background thread pool for e.g. I/O or network loading.
backpressureStrategy: BackpressureStrategy = BackpressureStrategy.LATEST BackpressureStrategy for the Flowable to use.

toFlowable

fun <Key : Any, Value : Any> 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
): Flowable<PagedList<Value>>

Deprecated.

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

The returned Flowable will already be subscribed on the fetchScheduler, and will perform all loading on that scheduler. It will already be observed on notifyScheduler, and will dispatch new PagedLists, as well as their updates to that scheduler.

Parameters
pageSize: Int Page size.
initialLoadKey: Key? = null Initial load key passed to the first PagedList / DataSource.
boundaryCallback: PagedList.BoundaryCallback<Value>? = null The boundary callback for listening to PagedList load state.
notifyScheduler: Scheduler? = null Scheduler that receives PagedList updates, and where PagedList.Callback calls are dispatched. Generally, this is the UI / main thread.
fetchScheduler: Scheduler? = null Scheduler used to fetch from DataSources, generally a background thread pool for e.g. I/O or network loading.
backpressureStrategy: BackpressureStrategy = BackpressureStrategy.LATEST BackpressureStrategy for the Flowable to use.

toLiveData

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

Deprecated.

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

No work (such as loading) is done immediately, the creation of the first PagedList is deferred until the LiveData is observed.

Parameters
config: PagedList.Config Paging configuration.
initialLoadKey: Key? = null Initial load key passed to the first PagedList / PagingSource.
boundaryCallback: PagedList.BoundaryCallback<Value>? = null The boundary callback for listening to PagedList load state.
coroutineScope: CoroutineScope = GlobalScope

Set the CoroutineScope that page loads should be launched within. The set coroutineScope allows a PagingSource to cancel running load operations when the results are no longer needed - for example, when the containing activity is destroyed.

Defaults to GlobalScope.

fetchDispatcher: CoroutineDispatcher = ArchTaskExecutor.getIOThreadExecutor() .asCoroutineDispatcher() CoroutineDispatcher for fetching data from PagingSources.

toLiveData

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

Deprecated.

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

No work (such as loading) is done immediately, the creation of the first PagedList is deferred until the LiveData is observed.

Parameters
pageSize: Int Page size.
initialLoadKey: Key? = null Initial load key passed to the first PagedList / PagingSource.
boundaryCallback: PagedList.BoundaryCallback<Value>? = null The boundary callback for listening to PagedList load state.
coroutineScope: CoroutineScope = GlobalScope

Set the CoroutineScope that page loads should be launched within. The set coroutineScope allows a PagingSource to cancel running load operations when the results are no longer needed - for example, when the containing activity is destroyed.

Defaults to GlobalScope.

fetchDispatcher: CoroutineDispatcher = ArchTaskExecutor.getIOThreadExecutor() .asCoroutineDispatcher() CoroutineDispatcher for fetching data from PagingSources.

toLiveData

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

Deprecated.

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

No work (such as loading) is done immediately, the creation of the first PagedList is deferred until the LiveData is observed.

Parameters
config: PagedList.Config Paging configuration.
initialLoadKey: Key? = null Initial load key passed to the first PagedList / PagingSource.
boundaryCallback: PagedList.BoundaryCallback<Value>? = null The boundary callback for listening to PagedList load state.
fetchExecutor: Executor = ArchTaskExecutor.getIOThreadExecutor() Executor for fetching data from PagingSources.

toLiveData

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

Deprecated.

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

No work (such as loading) is done immediately, the creation of the first PagedList is deferred until the LiveData is observed.

Parameters
pageSize: Int Page size.
initialLoadKey: Key? = null Initial load key passed to the first PagedList / PagingSource.
boundaryCallback: PagedList.BoundaryCallback<Value>? = null The boundary callback for listening to PagedList load state.
fetchExecutor: Executor = ArchTaskExecutor.getIOThreadExecutor() Executor for fetching data from DataSources.

toObservable

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

Deprecated.

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

The returned Observable will already be subscribed on the fetchScheduler, and will perform all loading on that scheduler. It will already be observed on notifyScheduler, and will dispatch new PagedLists, as well as their updates to that scheduler.

Parameters
config: PagedList.Config Paging configuration.
initialLoadKey: Key? = null Initial load key passed to the first PagedList / PagingSource.
boundaryCallback: PagedList.BoundaryCallback<Value>? = null The boundary callback for listening to PagedList load state.
notifyScheduler: Scheduler? = null Scheduler that receives PagedList updates, and where PagedList.Callback calls are dispatched. Generally, this is the UI / main thread.
fetchScheduler: Scheduler? = null Scheduler used to fetch from PagingSources, generally a background thread pool for e.g. I/O or network loading.

toObservable

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

Deprecated.

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

The returned Observable will already be subscribed on the fetchScheduler, and will perform all loading on that scheduler. It will already be observed on notifyScheduler, and will dispatch new PagedLists, as well as their updates to that scheduler.

Parameters
pageSize: Int Size of pages to load.
initialLoadKey: Key? = null Initial load key passed to the first PagedList / PagingSource.
boundaryCallback: PagedList.BoundaryCallback<Value>? = null The boundary callback for listening to PagedList load state.
notifyScheduler: Scheduler? = null Scheduler that receives PagedList updates, and where PagedList.Callback calls are dispatched. Generally, this is the UI / main thread.
fetchScheduler: Scheduler? = null Scheduler used to fetch from PagingSources, generally a background thread pool for e.g. I/O or network loading.

toObservable

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

Deprecated.

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

The returned Observable will already be subscribed on the fetchScheduler, and will perform all loading on that scheduler. It will already be observed on notifyScheduler, and will dispatch new PagedLists, as well as their updates to that scheduler.

Parameters
config: PagedList.Config Paging configuration.
initialLoadKey: Key? = null Initial load key passed to the first PagedList / DataSource.
boundaryCallback: PagedList.BoundaryCallback<Value>? = null The boundary callback for listening to PagedList load state.
notifyScheduler: Scheduler? = null Scheduler that receives PagedList updates, and where PagedList.Callback calls are dispatched. Generally, this is the UI / main thread.
fetchScheduler: Scheduler? = null Scheduler used to fetch from DataSources, generally a background thread pool for e.g. I/O or network loading.

toObservable

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

Deprecated.

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

The returned Observable will already be subscribed on the fetchScheduler, and will perform all loading on that scheduler. It will already be observed on notifyScheduler, and will dispatch new PagedLists, as well as their updates to that scheduler.

Parameters
pageSize: Int Size of pages to load.
initialLoadKey: Key? = null Initial load key passed to the first PagedList / DataSource.
boundaryCallback: PagedList.BoundaryCallback<Value>? = null The boundary callback for listening to PagedList load state.
notifyScheduler: Scheduler? = null Scheduler that receives PagedList updates, and where PagedList.Callback calls are dispatched. Generally, this is the UI / main thread.
fetchScheduler: Scheduler? = null Scheduler used to fetch from DataSources, generally a background thread pool for e.g. I/O or network loading.

Extension properties

liveData

val <Key : Any, Value : Any> Pager<Key, Value>.liveData: LiveData<PagingData<Value>>

A LiveData of PagingData, which mirrors the stream provided by Pager.flow, but exposes it as a LiveData.