Config

open class Config
kotlin.Any
   ↳ androidx.paging.PagedList.Config

Configures how a PagedList loads content from its DataSource.

Use a Config Builder to construct and define custom loading behavior, such as Builder#setPageSize(int), which defines number of items loaded at a time}.

Summary

Nested classes

Builder class for Config.

Constants

static Int

When maxSize is set to MAX_SIZE_UNBOUNDED, the maximum number of items loaded is unbounded, and pages will never be dropped.

Properties

Boolean

Defines whether the PagedList may display null placeholders, if the DataSource provides them.

Int

Size hint for initial load of PagedList, often larger than a regular page.

Int

Defines the maximum number of items that may be loaded into this pagedList before pages should be dropped.

Int

Size of each page loaded by the PagedList.

Int

Prefetch distance which defines how far ahead to load.

Constants

MAX_SIZE_UNBOUNDED

static val MAX_SIZE_UNBOUNDED: Int

When maxSize is set to MAX_SIZE_UNBOUNDED, the maximum number of items loaded is unbounded, and pages will never be dropped.

Value: Integer.MAX_VALUE

Properties

enablePlaceholders

val enablePlaceholders: Boolean

Defines whether the PagedList may display null placeholders, if the DataSource provides them.

initialLoadSizeHint

val initialLoadSizeHint: Int

Size hint for initial load of PagedList, often larger than a regular page.

maxSize

val maxSize: Int

Defines the maximum number of items that may be loaded into this pagedList before pages should be dropped.

PageKeyedDataSource does not currently support dropping pages - when loading from a PageKeyedDataSource, this value is ignored.

pageSize

val pageSize: Int

Size of each page loaded by the PagedList.

prefetchDistance

val prefetchDistance: Int

Prefetch distance which defines how far ahead to load.

If this value is set to 50, the paged list will attempt to load 50 items in advance of data that's already been accessed.