Nguyen  Minh Binh Nguyen Minh Binh - 1 year ago 191
Android Question

How to know viewpager is scroll left or right?

I am using ViewPager (support library). I want to know every time the ViewPager change the visible page, it is scrolling left or right.

Please give me a solution. Any recommend is welcome also.


Answer Source

set setOnPageChangeListener to your ViewPager

and in

public void onPageSelected(int arg0) {
      {//User Move to left}
     {//User Move to right}
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download