{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}
public final class CombinedLoadStates
Collection of pagination LoadState
s for both a PagingSource
, and RemoteMediator
.
Public fields |
|
---|---|
final @NonNull LoadState |
Convenience for combined behavior of |
final @Nullable LoadStates |
|
final @NonNull LoadState |
Convenience for combined behavior of |
final @NonNull LoadState |
Convenience for combined behavior of |
final @NonNull LoadStates |
|
Public constructors |
|
---|---|
CombinedLoadStates( |
@NonNull
public final @NonNull LoadState append
Convenience for combined behavior of APPEND
LoadState
, which generally defers to mediator
if it exists, but if previously was LoadState.Loading
, awaits for both source
and mediator
to become LoadState.NotLoading
to ensure the remote load was applied.
For use cases that require reacting to LoadState
of source
and mediator
specifically, e.g., showing cached data when network loads via mediator
fail, LoadStates
exposed via source
and mediator
should be used directly.
@Nullable
public final @Nullable LoadStates mediator
LoadStates
corresponding to loads from a RemoteMediator
, or null
if RemoteMediator
not present.
@NonNull
public final @NonNull LoadState prepend
Convenience for combined behavior of PREPEND
LoadState
, which generally defers to mediator
if it exists, but if previously was LoadState.Loading
, awaits for both source
and mediator
to become LoadState.NotLoading
to ensure the remote load was applied.
For use cases that require reacting to LoadState
of source
and mediator
specifically, e.g., showing cached data when network loads via mediator
fail, LoadStates
exposed via source
and mediator
should be used directly.
@NonNull
public final @NonNull LoadState refresh
Convenience for combined behavior of REFRESH
LoadState
, which generally defers to mediator
if it exists, but if previously was LoadState.Loading
, awaits for both source
and mediator
to become LoadState.NotLoading
to ensure the remote load was applied.
For use cases that require reacting to LoadState
of source
and mediator
specifically, e.g., showing cached data when network loads via mediator
fail, LoadStates
exposed via source
and mediator
should be used directly.
@NonNull
public final @NonNull LoadStates source
LoadStates
corresponding to loads from a PagingSource
.
@NonNull
public final CombinedLoadStates(
@NonNull LoadState refresh,
@NonNull LoadState prepend,
@NonNull LoadState append,
@NonNull LoadStates source,
@Nullable LoadStates mediator
)