LazyStaggeredGridDefaults


Contains the default values used by LazyVerticalStaggeredGrid and LazyHorizontalStaggeredGrid.

Summary

Public functions

cacheWindow

@Composable
fun cacheWindow(state: LazyStaggeredGridState): LazyLayoutCacheWindow

Creates and remembers the default LazyLayoutCacheWindow for LazyVerticalStaggeredGrid and LazyHorizontalStaggeredGrid.

  • 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: LazyStaggeredGridState

the LazyStaggeredGridState used to calculate the average visible item size