Refresh
class Refresh<Key : Any> : PagingSource.LoadParams<Key>
kotlin.Any | ||
↳ | androidx.paging.PagingSource.LoadParams<Key> | |
↳ | androidx.paging.PagingSource.LoadParams.Refresh |
Params for an initial load request on a PagingSource from PagingSource.load or a refresh triggered by invalidate.
Summary
Public constructors | |
---|---|
Params for an initial load request on a PagingSource from PagingSource.load or a refresh triggered by invalidate. |
Properties | |
---|---|
Key? |
Key for the page to be loaded. |
Inherited properties | |
---|---|
Public constructors
<init>
Refresh(
key: Key?,
loadSize: Int,
placeholdersEnabled: Boolean)
Params for an initial load request on a PagingSource from PagingSource.load or a refresh triggered by invalidate.
Properties
key
val key: Key?
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
initialKey
passed to the Pager. - On subsequent loads due to invalidation or refresh, the result of PagingSource.getRefreshKey.
- On initial load, the nullable
- Prepend - LoadResult.Page.prevKey of the loaded page at the front of the list.
- Append - LoadResult.Page.nextKey of the loaded page at the end of the list.