Contains the default values used by LazyColumn and LazyRow.

Summary

Public functions

LazyLayoutCacheWindow

Creates and remembers the default LazyLayoutCacheWindow for LazyColumn and LazyRow.

Cmn

Public functions

cacheWindow

@Composable
fun cacheWindow(state: LazyListState): LazyLayoutCacheWindow

Creates and remembers the default LazyLayoutCacheWindow for LazyColumn and LazyRow.

  • Prefetches items ahead in the scroll direction based on the average size of visible items from state, clamped between 10% and 50% of the viewport.

  • Does not retain items behind the viewport.

  • Does not cache while the user is not scrolling.

Parameters
state: LazyListState

the LazyListState used to calculate the average visible item size