取消ViewPager跳转到任意item时候的跳转动画

public class ViewPagerScroll extends Scroller{
    private int mDuration = 0;

    public ViewPagerScroll(Context context) {
        super(context);
    }

    public ViewPagerScroll(Context context, Interpolator interpolator) {
        super(context, interpolator);
    }

    public ViewPagerScroll(Context context, Interpolator interpolator, boolean flywheel) {
        super(context, interpolator, flywheel);
    }


    @Override
    public void startScroll(int startX, int startY, int dx, int dy, int duration) {
        super.startScroll(startX, startY, dx, dy, mDuration);
    }

    @Override
    public void startScroll(int startX, int startY, int dx, int dy) {
        super.startScroll(startX, startY, dx, dy, mDuration);
    }
}

然后在ViewPager初始化时候调用

你可能感兴趣的:(取消ViewPager跳转到任意item时候的跳转动画)