RxPagedListBuilder

public final class RxPagedListBuilder<Key extends Object, Value extends Object>


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.

Parameters
<Key extends Object>

Type of input valued used to load data from the DataSource. Must be integer if you're using PositionalDataSource.

<Value extends Object>

Item type being presented.

Summary

Public constructors

<Key extends Object, Value extends Object> RxPagedListBuilder(
    @NonNull Function0<@NonNull PagingSource<@NonNull Key, @NonNull Value>> pagingSourceFactory,
    @NonNull PagedList.Config config
)

Creates a RxPagedListBuilder with required parameters.

<Key extends Object, Value extends Object> RxPagedListBuilder(
    @NonNull Function0<@NonNull PagingSource<@NonNull Key, @NonNull Value>> pagingSourceFactory,
    int pageSize
)

Creates a RxPagedListBuilder with required parameters.

<Key extends Object, Value extends Object> RxPagedListBuilder(
    @NonNull DataSource.Factory<@NonNull Key, @NonNull Value> dataSourceFactory,
    @NonNull PagedList.Config config
)

Creates a RxPagedListBuilder with required parameters.

<Key extends Object, Value extends Object> RxPagedListBuilder(
    @NonNull DataSource.Factory<@NonNull Key, @NonNull Value> dataSourceFactory,
    int pageSize
)

Creates a RxPagedListBuilder with required parameters.

Public methods

final @NonNull Flowable<@NonNull PagedList<@NonNull Value>>

Constructs a Flowable<PagedList>.

final @NonNull Observable<@NonNull PagedList<@NonNull Value>>

Constructs a Observable<PagedList>.

final @NonNull RxPagedListBuilder<@NonNull Key, @NonNull Value>

Sets a androidx.paging.PagedList.BoundaryCallback on each PagedList created, typically used to load additional data from network when paging from local storage.

final @NonNull RxPagedListBuilder<@NonNull Key, @NonNull Value>

Sets scheduler which will be used for background fetching of PagedLists, as well as on-demand fetching of pages inside.

final @NonNull RxPagedListBuilder<@NonNull Key, @NonNull Value>

First loading key passed to the first PagedList/DataSource.

final @NonNull RxPagedListBuilder<@NonNull Key, @NonNull Value>

Sets scheduler which will be used for observing new PagedLists, as well as loading updates within the PagedLists.

Public constructors

RxPagedListBuilder

public final <Key extends Object, Value extends Object> RxPagedListBuilder(
    @NonNull Function0<@NonNull PagingSource<@NonNull Key, @NonNull Value>> pagingSourceFactory,
    @NonNull PagedList.Config config
)

Creates a RxPagedListBuilder with required parameters.

Parameters
@NonNull Function0<@NonNull PagingSource<@NonNull Key, @NonNull Value>> pagingSourceFactory

DataSource factory providing DataSource generations.

@NonNull PagedList.Config config

Paging configuration.

RxPagedListBuilder

public final <Key extends Object, Value extends Object> RxPagedListBuilder(
    @NonNull Function0<@NonNull PagingSource<@NonNull Key, @NonNull Value>> pagingSourceFactory,
    int pageSize
)

Creates a RxPagedListBuilder with required parameters.

This method is a convenience for:

RxPagedListBuilder(
pagingSourceFactory,
PagedList.Config.Builder().setPageSize(pageSize).build()
)
Parameters