android - How to set the point, after which the ViewPager swipes to another View? -
if more 50% of follower of view b visible, on release viewpager animate view b
instead of goind view a
.
how can change point of switching 50% x%?
you can overriding onscrollchanged() function, here's example:
@override public void onscrollchanged(viewpager vp, int x, int y, int oldx, int oldy) { // take last son in viewpager view view = (view) vp.getchildat(vp.getchildcount() - 1); if (diff < view.getbottom()/2) { // animation } }
let me know if worked or not (in order me know if should remove answer here).
thanks
Comments
Post a Comment