scrollToPage

suspend fun scrollToPage(@IntRange(from = 0.toLong()page: Int, @FloatRange(from = -1.0.toDouble(), to = 1.0.toDouble()pageOffset: Float = 0f)

Instantly brings the item at page to the middle of the viewport.

Cancels the currently running scroll, if any, and suspends until the cancellation is complete.

Parameters

page

the page to snap to. Must be >= 0.

pageOffset

the percentage of the page size to offset, from the start of page. Must be in the range -1f..1f.

Sources

androidJvm source
Link copied to clipboard