StripGrid
Which source times the strip's tiles sit at, and which of them are on screen.
Tiles are addressed in content pixels, so a tile keeps the source time it shows no matter how far the strip has scrolled. positions feeds rememberFilmstripFrames and visibleRange feeds FilmstripFrames.onVisibleRange .
val grid = remember(scale, tileWidthPx) { StripGrid(scale, tileWidthPx) }
val frames = rememberFilmstripFrames(filmstrip, composition, grid.positions, heightPx)
// Only a strip drawn by hand needs this. FilmstripStrip reports its own window.
LaunchedEffect(grid, frames) {
snapshotFlow { listState.stripScrollPx(grid) }.collect { scrollPx ->
val window = grid.visibleRange(scrollPx, viewportWidthPx)
if (!window.isEmpty()) frames.onVisibleRange(window.first, window.last)
}
}Content copied to clipboard
Properties
Functions
Link copied to clipboard
How wide the tile at index is drawn.
Link copied to clipboard
Which tiles a viewport viewportWidthPx wide shows when scrolled to scrollPx.
Link copied to clipboard
The same grid at scale.
Link copied to clipboard
The same grid with tiles tileWidthPx wide.