calculateCurrentOffsetForPage

fun PagerScope.calculateCurrentOffsetForPage(page: Int): Float

Calculate the offset for the given page from the current scroll position. This is useful when using the scroll position to apply effects or animations to items.

The returned offset can positive or negative, depending on whether which direction the page is compared to the current scroll position.

Samples

com.google.accompanist.sample.pager.HorizontalPagerWithOffsetTransition