LazyLayoutPrefetchState


State for lazy items prefetching, used by lazy layouts to instruct the prefetcher.

Note: this class is a part of LazyLayout harness that allows for building custom lazy layouts. LazyLayout and all corresponding APIs are still under development and are subject to change.

Summary

Public constructors

Cmn

Public functions

LazyLayoutPrefetchState.PrefetchHandle
schedulePrefetch(index: Int, constraints: Constraints)

Schedules precomposition and premeasure for the new item.

Cmn

Public constructors

LazyLayoutPrefetchState

LazyLayoutPrefetchState(prefetchExecutor: PrefetchExecutor? = null)
Parameters
prefetchExecutor: PrefetchExecutor? = null

the PrefetchExecutor implementation to use to execute prefetch requests. If null is provided, the default PrefetchExecutor for the platform will be used.

Public functions

schedulePrefetch

fun schedulePrefetch(index: Int, constraints: Constraints): LazyLayoutPrefetchState.PrefetchHandle

Schedules precomposition and premeasure for the new item.

Parameters
index: Int

item index to prefetch.

constraints: Constraints

Constraints to use for premeasuring.