androidx.compose.foundation.lazy.layout

LazyLayoutCacheWindowSince 1.9Experimental

Interface · from org.jetbrains.compose.foundation:foundation:1.12.2

No hand-written docs yet.

Represents an out of viewport area of a Lazy Layout where items should be cached. Items will be prepared in the Cache Window area in advance to improve scroll performance.

interface LazyLayoutCacheWindow

How to get one

Create it

Used by

Parameters that take a LazyLayoutCacheWindow.

Functions

calculateAheadWindow

fun Density.calculateAheadWindow(viewport: Int): Int

Calculates the prefetch window area in pixels for prefetching on the scroll direction, "ahead window". The prefetch window strategy will prepare items in the ahead area in advance s they are ready to be used when they become visible.

calculateBehindWindow

fun Density.calculateBehindWindow(viewport: Int): Int

Calculates the window area in pixels for keeping items in the scroll counter direction, "behind window". Items in the behind window will not be disposed and can be accessed more quickly if they become visible again.

Library docs

Represents an out of viewport area of a Lazy Layout where items should be cached. Items will be prepared in the Cache Window area in advance to improve scroll performance.