android viewpager: reset adjacent fragment's scroll position -
i'm using viewpager , slidingtablayout implementing tabs in activity. activity has 5 fragments. i'm trying achieve when user starts scrolling switch tabs, need reset scrolly of new fragment (that in memory due viewpager caching becoming visible) value.
i tried using fragment.onresume not work. using viewpager.onpagechangelistener.onpagescrollstatechanged, i'm able capture when user starts scrolling left/right, how access new fragment becoming visible can reset it's scroll position?
you can use viewpager.pagetransformer
take coming page whatever wanted, :
@override public void transformpage(view page, float position) { page.setscrolly(100); ... }
this question , answers tell details.
Comments
Post a Comment