RxPagedListBuilder
classRxPagedListBuilder<Key : Any, Value : Any>
kotlin.Any | |
↳ | androidx.paging.RxPagedListBuilder |
Builder for Observable<PagedList>
or Flowable<PagedList>
, given a DataSource.Factory and a
PagedList.Config.
The required parameters are in the constructor, so you can simply construct and build, or optionally enable extra features (such as initial load key, or BoundaryCallback).
The returned observable/flowable will already be subscribed on the setFetchScheduler, and will perform all loading on that scheduler. It will already be observed on setNotifyScheduler, and will dispatch new PagedLists, as well as their updates to that scheduler.
Summary
Public constructors | |
---|---|
<init>(pagingSourceFactory: () -> PagingSource<Key, Value>, config: PagedList.Config) Creates a RxPagedListBuilder with required parameters. |
|
<init>(pagingSourceFactory: () -> PagingSource<Key, Value>, pageSize: Int) Creates a RxPagedListBuilder with required parameters. |
|
<init>(dataSourceFactory: DataSource.Factory<Key, Value>, config: PagedList.Config) Creates a RxPagedListBuilder with required parameters. |
|
<init>(dataSourceFactory: DataSource.Factory<Key, Value>, pageSize: Int) Creates a RxPagedListBuilder with required parameters. |
Public methods | |
---|---|
Flowable<PagedList<Value>> |
buildFlowable(backpressureStrategy: BackpressureStrategy) Constructs a |
Observable<PagedList<Value>> |
Constructs a |
RxPagedListBuilder<Key, Value> |
setBoundaryCallback(boundaryCallback: PagedList.BoundaryCallback<Value>?) Sets a androidx.paging.PagedList.BoundaryCallback on each PagedList created, typically used to load additional data from network when paging from local storage. |
RxPagedListBuilder<Key, Value> |
setFetchScheduler(scheduler: Scheduler) Sets scheduler which will be used for background fetching of PagedLists, as well as on-demand fetching of pages inside. |
RxPagedListBuilder<Key, Value> |
setInitialLoadKey(key: Key?) First loading key passed to the first PagedList/DataSource. |
RxPagedListBuilder<Key, Value> |
setNotifyScheduler(scheduler: Scheduler) Sets scheduler which will be used for observing new PagedLists, as well as loading updates within the PagedLists. |
Public constructors
<init>
RxPagedListBuilder(
pagingSourceFactory: () -> PagingSource<Key, Value>,
config: PagedList.Config)
Creates a RxPagedListBuilder with required parameters.
Parameters | |
---|---|
pagingSourceFactory: () -> PagingSource<Key, Value> | DataSource factory providing DataSource generations. |
config: PagedList.Config | Paging configuration. |
<init>
RxPagedListBuilder(
pagingSourceFactory: () -> PagingSource<Key, Value>,
pageSize: Int)
Creates a RxPagedListBuilder with required parameters.
This method is a convenience for:
RxPagedListBuilder( pagingSourceFactory, PagedList.Config.Builder().setPageSize(pageSize).build() )
Parameters | |
---|---|
pagingSourceFactory: () -> PagingSource<Key, Value> | PagingSource factory providing PagingSource generations. |
pageSize: Int | Size of pages to load. |
<init>
RxPagedListBuilder(
dataSourceFactory: DataSource.Factory<Key, Value>,
config: PagedList.Config)
Creates a RxPagedListBuilder with required parameters.
Parameters | |
---|---|
dataSourceFactory: DataSource.Factory<Key, Value> | DataSource factory providing DataSource generations. |
config: PagedList.Config | Paging configuration. |