rememberLazyStaggeredGridState

Functions summary

LazyStaggeredGridState
@Composable
rememberLazyStaggeredGridState(
    initialFirstVisibleItemIndex: Int,
    initialFirstVisibleItemScrollOffset: Int
)

Creates a LazyStaggeredGridState that is remembered across composition.

Cmn

Functions

rememberLazyStaggeredGridState

@Composable
fun rememberLazyStaggeredGridState(
    initialFirstVisibleItemIndex: Int = 0,
    initialFirstVisibleItemScrollOffset: Int = 0
): LazyStaggeredGridState

Creates a LazyStaggeredGridState that is remembered across composition.

Calling this function with different parameters on recomposition WILL NOT recreate or change the state. Use LazyStaggeredGridState.scrollToItem or LazyStaggeredGridState.animateScrollToItem to adjust position instead.

Parameters
initialFirstVisibleItemIndex: Int = 0

initial position for LazyStaggeredGridState.firstVisibleItemIndex

initialFirstVisibleItemScrollOffset: Int = 0

initial value for LazyStaggeredGridState.firstVisibleItemScrollOffset

Returns
LazyStaggeredGridState

created and memoized LazyStaggeredGridState with given parameters.