Code example for ViewPager

0
    public MyViewPager(Context context) {
        super(context);
    } 
 
    public MyViewPager(Context context, AttributeSet attrs) {
        super(context, attrs);
    } 
 
    public void setGestureDetector(GestureDetector gestureDetector) {
        this.gestureDetector = gestureDetector;
    } 
 
    @Override 
    public boolean onTouchEvent(MotionEvent ev) {
        if (this.gestureDetector != null)
            this.gestureDetector.onTouchEvent(ev);
        return super.onTouchEvent(ev);
    } 
 
    @Override 
Stop searching for code, let great code find you!  Add Codota to your java IDE