{% setvar book_path %}/reference/kotlin/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}
sealed class PagingSource.LoadParams<Key : Any>
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
.
Nested types |
|
---|---|
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 |
Public properties |
|
---|---|
abstract Key? |
Key for the page to be loaded. |
Int |
Requested number of items to load. |
Boolean |
From |
abstract 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
.
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.
val loadSize: Int
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.
val placeholdersEnabled: Boolean
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.