Google is committed to advancing racial equity for Black communities. See how.

LoadParams

sealed class LoadParams<Key : Any>
kotlin.Any
   ↳ androidx.paging.PagingSource.LoadParams

Params for a load request on a PagingSource from PagingSource.load.

Summary

Nested classes

Params to load a page of data from a PagingSource via PagingSource.load to be appended to the end of the list.

Params to load a page of data from a PagingSource via PagingSource.load to be prepended to the start of the list.

Params for an initial load request on a PagingSource from PagingSource.load or a refresh triggered by invalidate.

Properties
abstract Key?

Key for the page to be loaded.

Int

Requested number of items to load.

Int

From PagingConfig.pageSize, the configured page size.

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.

Properties

key

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:

loadSize

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.

pageSize

val pageSize: Int

Deprecated.

From PagingConfig.pageSize, the configured page size.

placeholdersEnabled

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.