Skip to content

Commit 24f689b

Browse files
Merge pull request #155 from Omega-R/scroll_pager_bug
Scroll pager bug
2 parents b09cbc7 + 6d0b721 commit 24f689b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

omegarecyclerview/src/main/java/com/omega_r/libs/omegarecyclerview/viewpager/ViewPagerLayoutManager.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,9 @@ private int calculateScrollPosition(int position) {
445445
int itemCount = super.getItemCount();
446446
if (mIsInfinite && itemCount != 0) {
447447
int currentWindowPosition = mCurrentPosition / itemCount;
448+
if (mCurrentPosition > position + (currentWindowPosition * itemCount)) {
449+
currentWindowPosition++;
450+
}
448451
return currentWindowPosition * itemCount + position;
449452
}
450453
return position;

0 commit comments

Comments
 (0)