public class

PagedList.Config

extends java.lang.Object

 java.lang.Object

↳androidx.paging.PagedList.Config

Overview

Configures how a PagedList loads content from its DataSource.

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

Summary

Fields
public final booleanenablePlaceholders

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

public final intinitialLoadSizeHint

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

public static final intMAX_SIZE_UNBOUNDED

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

public final intmaxSize

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

public final intpageSize

Size of each page loaded by the PagedList.

public final intprefetchDistance

Prefetch distance which defines how far ahead to load.

Methods
from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Fields

public static final int MAX_SIZE_UNBOUNDED

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

public final int pageSize

Size of each page loaded by the PagedList.

public final int prefetchDistance

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.

See also: PagedList.loadAround(int)

public final boolean enablePlaceholders

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

public final int maxSize

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.

See also: PagedList.Config.MAX_SIZE_UNBOUNDED, PagedList.Config.Builder.setMaxSize(int)

public final int initialLoadSizeHint

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