florent37 / MaterialViewPager

A Material Design ViewPager easy to use library
https://www.fiches-plateau-moto.fr
Apache License 2.0
8.14k stars 1.48k forks source link

Scrolling on one page influences scroll position on other page #278

Open zirkler opened 8 years ago

zirkler commented 8 years ago

Hi,

when I scroll down on page 1 so that the header shrinks, and haven't even touched page 2, then switch to page 2, page 2 is scrolled down a lil bit (probably the height of the header). How can I avoid this behavior?

Thanks and best regards.

zirkler commented 8 years ago

out

nuhkoca commented 8 years ago

Okay, you need to use this code onPageSelected of ViewPager

this works

MaterialViewPagerHelper.getAnimatorContext(context).onMaterialScrolled(null,0)

zirkler commented 8 years ago

@nuhkoca Thanks for your response. Your code brings back the header, but I only want the view below to be scrolled on top. Any idea on this?

nuhkoca commented 8 years ago

@zirkler I haven't tried before I don't have any idea abou that but you can try and say to me how to solve. At the same time I am gonna search sth about that. :)

TigerHix commented 8 years ago

I'm having this issue too! Weird, different pages should have different scroll states. @florent37

vanjavanjavanja commented 7 years ago

+1 for this issue, @florent37

xjpmauricio commented 7 years ago

Thanks, your suggestion saved me!

Here's my MaterialViewPager class, onPageSelected method: onPageSelected.txt

hmathur127 commented 7 years ago

hello.....does anybody find solution for this problem... Thanx in advance. :)

daniestrella1 commented 7 years ago

+1 for this issue, @florent37

hmathur127 commented 7 years ago

+1 for this issue, @florent37