rememberLazyListState

Functions summary

LazyListState
@Composable
rememberLazyListState(
    initialFirstVisibleItemIndex: Int,
    initialFirstVisibleItemScrollOffset: Int
)

Creates a LazyListState that is remembered across compositions.

Cmn
LazyListState
@ExperimentalFoundationApi
@Composable
rememberLazyListState(
    cacheWindow: LazyLayoutCacheWindow,
    initialFirstVisibleItemIndex: Int,
    initialFirstVisibleItemScrollOffset: Int
)

Creates a LazyListState that is remembered across compositions.

Cmn
LazyListState
@ExperimentalFoundationApi
@Composable
rememberLazyListState(
    initialFirstVisibleItemIndex: Int,
    initialFirstVisibleItemScrollOffset: Int,
    prefetchStrategy: LazyListPrefetchStrategy
)

Creates a LazyListState that is remembered across compositions.

Cmn

Functions

rememberLazyListState

@Composable
fun rememberLazyListState(
    initialFirstVisibleItemIndex: Int = 0,
    initialFirstVisibleItemScrollOffset: Int = 0
): LazyListState

Creates a LazyListState that is remembered across compositions.

Changes to the provided initial values will not result in the state being recreated or changed in any way if it has already been created.

Parameters
initialFirstVisibleItemIndex: Int = 0

the initial value for LazyListState.firstVisibleItemIndex

initialFirstVisibleItemScrollOffset: Int = 0

the initial value for LazyListState.firstVisibleItemScrollOffset

rememberLazyListState

@ExperimentalFoundationApi
@Composable
fun rememberLazyListState(
    cacheWindow: LazyLayoutCacheWindow,
    initialFirstVisibleItemIndex: Int = 0,
    initialFirstVisibleItemScrollOffset: Int = 0
): LazyListState

Creates a LazyListState that is remembered across compositions.

Changes to the provided initial values will not result in the state being recreated or changed in any way if it has already been created.

Parameters
cacheWindow: LazyLayoutCacheWindow

specifies the size of the ahead and behind window to be used as per LazyLayoutCacheWindow.

initialFirstVisibleItemIndex: Int = 0

the initial value for LazyListState.firstVisibleItemIndex

initialFirstVisibleItemScrollOffset: Int = 0

the initial value for LazyListState.firstVisibleItemScrollOffset

rememberLazyListState

@ExperimentalFoundationApi
@Composable
fun rememberLazyListState(
    initialFirstVisibleItemIndex: Int = 0,
    initialFirstVisibleItemScrollOffset: Int = 0,
    prefetchStrategy: LazyListPrefetchStrategy = remember { LazyListPrefetchStrategy() }
): LazyListState

Creates a LazyListState that is remembered across compositions.

Changes to the provided initial values will not result in the state being recreated or changed in any way if it has already been created.

Parameters
initialFirstVisibleItemIndex: Int = 0

the initial value for LazyListState.firstVisibleItemIndex

initialFirstVisibleItemScrollOffset: Int = 0

the initial value for LazyListState.firstVisibleItemScrollOffset

prefetchStrategy: LazyListPrefetchStrategy = remember { LazyListPrefetchStrategy() }

the LazyListPrefetchStrategy to use for prefetching content in this list