LivePagedListKt

public final class LivePagedListKt


Summary

Public methods

static final @NonNull LiveData<@NonNull PagedList<@NonNull Value>>
<Key extends Object, Value extends Object> LivePagedListKt.toLiveData(
    @NonNull DataSource.Factory<@NonNull Key, @NonNull Value> receiver,
    @NonNull PagedList.Config config,
    @Nullable Key initialLoadKey,
    @Nullable PagedList.BoundaryCallback<@NonNull Value> boundaryCallback,
    @NonNull Executor fetchExecutor
)

This method is deprecated. PagedList is deprecated and has been replaced by PagingData

static final @NonNull LiveData<@NonNull PagedList<@NonNull Value>>
<Key extends Object, Value extends Object> LivePagedListKt.toLiveData(
    @NonNull DataSource.Factory<@NonNull Key, @NonNull Value> receiver,
    int pageSize,
    @Nullable Key initialLoadKey,
    @Nullable PagedList.BoundaryCallback<@NonNull Value> boundaryCallback,
    @NonNull Executor fetchExecutor
)

This method is deprecated. PagedList is deprecated and has been replaced by PagingData

static final @NonNull LiveData<@NonNull PagedList<@NonNull Value>>
<Key extends Object, Value extends Object> LivePagedListKt.toLiveData(
    @NonNull Function0<@NonNull PagingSource<@NonNull Key, @NonNull Value>> receiver,
    @NonNull PagedList.Config config,
    @Nullable Key initialLoadKey,
    @Nullable PagedList.BoundaryCallback<@NonNull Value> boundaryCallback,
    @NonNull CoroutineScope coroutineScope,
    @NonNull CoroutineDispatcher fetchDispatcher
)

This method is deprecated. PagedList is deprecated and has been replaced by PagingData

static final @NonNull LiveData<@NonNull PagedList<@NonNull Value>>
<Key extends Object, Value extends Object> LivePagedListKt.toLiveData(
    @NonNull Function0<@NonNull PagingSource<@NonNull Key, @NonNull Value>> receiver,
    int pageSize,
    @Nullable Key initialLoadKey,
    @Nullable PagedList.BoundaryCallback<@NonNull Value> boundaryCallback,
    @NonNull CoroutineScope coroutineScope,
    @NonNull CoroutineDispatcher fetchDispatcher
)

This method is deprecated. PagedList is deprecated and has been replaced by PagingData

Public methods

LivePagedListKt.toLiveData

@NonNull
public static final LiveData<@NonNull PagedList<@NonNull Value>> <Key extends Object, Value extends Object> LivePagedListKt.toLiveData(
    @NonNull DataSource.Factory<@NonNull Key, @NonNull Value> receiver,
    @NonNull PagedList.Config config,
    @Nullable Key initialLoadKey,
    @Nullable PagedList.BoundaryCallback<@NonNull Value> boundaryCallback,
    @NonNull Executor fetchExecutor
)

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
@NonNull PagedList.Config config

Paging configuration.

@Nullable Key initialLoadKey

Initial load key passed to the first PagedList / PagingSource.

@Nullable PagedList.BoundaryCallback<@NonNull Value> boundaryCallback

The boundary callback for listening to PagedList load state.

@NonNull Executor fetchExecutor

Executor for fetching data from PagingSources.

LivePagedListKt.toLiveData

@NonNull
public static final LiveData<@NonNull PagedList<@NonNull Value>> <Key extends Object, Value extends Object> LivePagedListKt.toLiveData(
    @NonNull DataSource.Factory<@NonNull Key, @NonNull Value> receiver,
    int pageSize,
    @Nullable Key initialLoadKey,
    @Nullable PagedList.BoundaryCallback<@NonNull Value> boundaryCallback,
    @NonNull Executor fetchExecutor
)

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
int pageSize

Page size.

@Nullable Key initialLoadKey

Initial load key passed to the first PagedList / PagingSource.

@Nullable PagedList.BoundaryCallback<@NonNull Value> boundaryCallback

The boundary callback for listening to PagedList load state.

@NonNull Executor fetchExecutor

Executor for fetching data from DataSources.

LivePagedListKt.toLiveData

@NonNull
public static final LiveData<@NonNull PagedList<@NonNull Value>> <Key extends Object, Value extends Object> LivePagedListKt.toLiveData(
    @NonNull Function0<@NonNull PagingSource<@NonNull Key, @NonNull Value>> receiver,
    @NonNull PagedList.Config config,
    @Nullable Key initialLoadKey,
    @Nullable PagedList.BoundaryCallback<@NonNull Value> boundaryCallback,
    @NonNull CoroutineScope coroutineScope,
    @NonNull CoroutineDispatcher fetchDispatcher
)

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
@NonNull PagedList.Config config

Paging configuration.

@Nullable Key initialLoadKey

Initial load key passed to the first PagedList / PagingSource.

@Nullable PagedList.BoundaryCallback<@NonNull Value> boundaryCallback

The boundary callback for listening to PagedList load state.

@NonNull CoroutineScope coroutineScope

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.

@NonNull CoroutineDispatcher fetchDispatcher

CoroutineDispatcher for fetching data from PagingSources.

LivePagedListKt.toLiveData

@NonNull
public static final LiveData<@NonNull PagedList<@NonNull Value>> <Key extends Object, Value extends Object> LivePagedListKt.toLiveData(
    @NonNull Function0<@NonNull PagingSource<@NonNull Key, @NonNull Value>> receiver,
    int pageSize,
    @Nullable Key initialLoadKey,
    @Nullable PagedList.BoundaryCallback<@NonNull Value> boundaryCallback,
    @NonNull CoroutineScope coroutineScope,
    @NonNull CoroutineDispatcher fetchDispatcher
)

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
int pageSize

Page size.

@Nullable Key initialLoadKey

Initial load key passed to the first PagedList / PagingSource.

@Nullable PagedList.BoundaryCallback<@NonNull Value> boundaryCallback

The boundary callback for listening to PagedList load state.

@NonNull CoroutineScope coroutineScope

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.

@NonNull CoroutineDispatcher fetchDispatcher

CoroutineDispatcher for fetching data from PagingSources.