{% setvar book_path %}/reference/kotlin/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

PagingSource.LoadParams.Prepend

{% setvar page_path %}androidx/paging/PagingSource.LoadParams.Prepend.html{% endsetvar %} {% setvar can_switch %}1{% endsetvar %} {% include "reference/_kotlin_switcher2.md" %}

class PagingSource.LoadParams.Prepend<Key : Any> : PagingSource.LoadParams

Any
   ↳ PagingSource.LoadParams
     ↳ PagingSource.LoadParams.Prepend

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

Summary

Public properties

open Key

Key for the page to be loaded.

Int

Requested number of items to load.

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.

Public constructors

<Key : Any> Prepend(key: Key, loadSize: Int, placeholdersEnabled: Boolean)

Public properties

key

open 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 loadSizeInt

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.

placeholdersEnabled

val placeholdersEnabledBoolean

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.

Public constructors

Prepend

<Key : Any> Prepend(key: Key, loadSize: Int, placeholdersEnabled: Boolean)