rememberMessageListState

fun rememberMessageListState(initialFirstVisibleItemIndex: Int = 0, initialFirstVisibleItemScrollOffset: Int = 0, parentMessageId: String? = null, messageOffsetHandler: MessagesLazyListState.MessageOffsetHandler = MessagesLazyListState.defaultOffsetHandler): MessagesLazyListState

Provides a MessagesLazyListState that's tied to a given message list. This is the default behavior, where we keep the base scroll position of the list persisted at all times, while the thread scroll state is always new, whenever we enter a thread.

In case you want to customize the behavior, provide the MessagesLazyListState based on your logic and conditions.

Return

MessagesLazyListState that keeps the scrolling position and offset of the given list and focused message.

Parameters

initialFirstVisibleItemIndex

The first visible item index that's required for the base MessagesLazyListState.lazyListState.

initialFirstVisibleItemScrollOffset

The offset of the first visible item, required for the base MessagesLazyListState.lazyListState.

parentMessageId

The ID of the parent message, if we're in a thread.