PagingSource.LoadParams
public sealed class PagingSource.LoadParams<Key extends Object>
PagingSource.LoadParams.Append |
Params to load a page of data from a |
PagingSource.LoadParams.Prepend |
Params to load a page of data from a |
PagingSource.LoadParams.Refresh |
Params for an initial load request on a |
Params for a load request on a PagingSource from PagingSource.load.
Summary
Nested types |
|---|
public final class PagingSource.LoadParams.Append<Key extends Object> extends PagingSource.LoadParamsParams to load a page of data from a |
public final class PagingSource.LoadParams.Prepend<Key extends Object> extends PagingSource.LoadParamsParams to load a page of data from a |
public final class PagingSource.LoadParams.Refresh<Key extends Object> extends PagingSource.LoadParamsParams for an initial load request on a |
Protected constructors |
|---|
<Key extends Object> LoadParams(int loadSize, boolean placeholdersEnabled) |
Public methods |
|
|---|---|
abstract Key |
getKey()Key for the page to be loaded. |
final int |
Requested number of items to load. |
final boolean |
From |
Protected constructors
Public methods
getKey
public abstract Key getKey()
Key for the page to be loaded.
key can be null only if this LoadParams is Refresh, and either no initialKey is provided to the Pager or PagingSource.getRefreshKey from the previous PagingSource returns null.
The value of key is dependent on the type of LoadParams:
-
On initial load, the nullable
initialKeypassed to thePager. -
On subsequent loads due to invalidation or refresh, the result of
PagingSource.getRefreshKey. -
Prepend-LoadResult.Page.prevKeyof the loaded page at the front of the list. -
Append-LoadResult.Page.nextKeyof the loaded page at the end of the list.
getLoadSize
public final int getLoadSize()
Requested number of items to load.
Note: It is valid for PagingSource.load to return a LoadResult that has a different number of items than the requested load size.
getPlaceholdersEnabled
public final boolean getPlaceholdersEnabled()
From PagingConfig.enablePlaceholders, true if placeholders are enabled and the load request for this LoadParams should populate LoadResult.Page.itemsBefore and LoadResult.Page.itemsAfter if possible.