Contains the default values used by LazyVerticalGrid and LazyHorizontalGrid.

Summary

Public functions

LazyLayoutCacheWindow

Creates and remembers the default LazyLayoutCacheWindow for LazyVerticalGrid and LazyHorizontalGrid.

Cmn

Public functions

cacheWindow

@Composable
fun cacheWindow(state: LazyGridState): LazyLayoutCacheWindow

Creates and remembers the default LazyLayoutCacheWindow for LazyVerticalGrid and LazyHorizontalGrid.

  • Prefetches items ahead in the scroll direction based on the average size of visible lines 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: LazyGridState

the LazyGridState used to calculate the average visible line size