LoadState

public sealed class LoadState

Known direct subclasses
LoadState.Error

Loading hit an error.

LoadState.Loading

Loading is in progress.

LoadState.NotLoading

Indicates the PagingData is not currently loading, and no error currently observed.


LoadState of a PagedList load - associated with a LoadType

LoadState of any LoadType may be observed for UI purposes by registering a listener via androidx.paging.PagingDataAdapter.addLoadStateListener or androidx.paging.AsyncPagingDataDiffer.addLoadStateListener

See also
LoadType

Summary

Nested types

public final class LoadState.Error extends LoadState

Loading hit an error.

public static class LoadState.Loading extends LoadState

Loading is in progress.

public final class LoadState.NotLoading extends LoadState

Indicates the PagingData is not currently loading, and no error currently observed.

Protected constructors

LoadState(boolean endOfPaginationReached)

Public methods

final boolean

false if there is more data to load in the LoadType this LoadState is associated with, true otherwise.

Protected constructors

LoadState

protected LoadState(boolean endOfPaginationReached)
Parameters
boolean endOfPaginationReached

false if there is more data to load in the LoadType this LoadState is associated with, true otherwise. This parameter informs Pager if it should continue to make requests for additional data in this direction or if it should halt as the end of the dataset has been reached.

Note: The REFRESHLoadType.REFRESH always has LoadState.endOfPaginationReached set to false.

Public methods

getEndOfPaginationReached

Added in 3.0.0
public final boolean getEndOfPaginationReached()

false if there is more data to load in the LoadType this LoadState is associated with, true otherwise. This parameter informs Pager if it should continue to make requests for additional data in this direction or if it should halt as the end of the dataset has been reached.

Note: The REFRESHLoadType.REFRESH always has LoadState.endOfPaginationReached set to false.