Skip to content

ViewPager with pageMargin over-scroll not work when scrolling forward and backward#63

Open
tamhuynhit wants to merge 2 commits into
EverythingMe:masterfrom
tamhuynhit:fix-overscroll-disable-in-padding-viewpager
Open

ViewPager with pageMargin over-scroll not work when scrolling forward and backward#63
tamhuynhit wants to merge 2 commits into
EverythingMe:masterfrom
tamhuynhit:fix-overscroll-disable-in-padding-viewpager

Conversation

@tamhuynhit
Copy link
Copy Markdown

@tamhuynhit tamhuynhit commented Apr 12, 2019

I face the same issue as the one mentioned in #35 and #23

The Over scroll effect does not work properly when I use a ViewPager with setPageMargin to a non-zero value. I found out the problem comes from the ViewPager because it doesn't give us the correct positionOffset in onPageScrolled. The offset is very small nearly to 0 but not 0, the same for 1.

So a way to fix this is to compare the float mLastPagerScrollOffset approximately and it works

Please test this and let me know if there is any issue

Add Page margin option in ViewPager demo
@tamhuynhit tamhuynhit force-pushed the fix-overscroll-disable-in-padding-viewpager branch from 8844234 to 80ad0fb Compare April 14, 2019 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant