onViewportChanged

val onViewportChanged: (firstVisibleItemIndex: Int, lastVisibleItemIndex: Int) -> Unit

Invoked when the user has scrolled the list, such that the firstVisibleItemIndex or the lastVisibleItemIndex has changed. When the user performs a fling, onViewportChanged will be invoked multiple times.

The firstVisibleItemIndex is the index of the first partially visible item within the viewport. The lastVisibleItemIndex is the index of the last partially visible item within the viewport.