private void postInitViewPager(){
  try {
    Class<?> viewpager=ViewPager.class;
    Field scroller=viewpager.getDeclaredField("mScroller");
    scroller.setAccessible(true);
    Field interpolator=viewpager.getDeclaredField("sInterpolator");
    interpolator.setAccessible(true);
    mScroller=new ScrollerCustomDuration(getContext(),(Interpolator)interpolator.get(null));
    scroller.set(this,mScroller);
  }
 catch (  Exception e) {
  }
}

private void postInitViewPager ( ) { try { Class < ? > viewpager = ViewPager . class ; Field scroller = viewpager . getDeclaredField ( "mScroller" ) ; scroller . setAccessible ( true ) ; Field interpolator = viewpager . getDeclaredField ( "sInterpolator" ) ; interpolator . setAccessible ( true ) ; mScroller = new ScrollerCustomDuration ( getContext ( ) , ( Interpolator ) interpolator . get ( null ) ) ; scroller . set ( this , mScroller ) ; } catch ( Exception e ) { } }
override the scroller instance with our own class so we can change the duration
