smartScrollToIndex

fun LazyListState.smartScrollToIndex(coroutineScope: CoroutineScope, targetIndex: Int)(source)

Scrolls to the targetIndex while applying the same fast-scroll optimisation used by smartScrollToTop.

If the destination is far away, the list first jumps closer to the goal (within FAST_SCROLL_THRESHOLD items) to avoid long smooth animations and then animates the final segment.

Parameters

coroutineScope

Scope used to perform the scroll operations.

targetIndex

Absolute index that should end up at the top of the viewport.