Skip to content

Commit

Permalink
use currentPageOffset instead of currentPageLayoutInfo.offset, and ma…
Browse files Browse the repository at this point in the history
…ke PagerState.currentPageLayoutInfo private again
  • Loading branch information
wcaokaze committed Sep 21, 2022
1 parent 566ea76 commit 54fe52a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pager/src/main/java/com/google/accompanist/pager/Pager.kt
Expand Up @@ -468,7 +468,7 @@ private class ConsumeFlingNestedScrollConnection(
}

override suspend fun onPostFling(consumed: Velocity, available: Velocity): Velocity {
return if (pagerState.currentPageLayoutInfo?.offset != 0) {
return if (pagerState.currentPageOffset != 0f) {
// The Pager is already scrolling. This means that a nested scroll child was
// scrolled to end, and the Pager can use this fling
Velocity.Zero
Expand Down
Expand Up @@ -92,7 +92,7 @@ class PagerState(

internal var afterContentPadding = 0

internal val currentPageLayoutInfo: LazyListItemInfo?
private val currentPageLayoutInfo: LazyListItemInfo?
get() = lazyListState.layoutInfo.visibleItemsInfo.lastOrNull {
it.index == currentPage
}
Expand Down

0 comments on commit 54fe52a

Please sign in to comment.