Code example for ViewPager

Methods: onTouchEvent

0
 
    @Override 
    public boolean onTouchEvent(MotionEvent ev) {
        if (this.gestureDetector != null)
            this.gestureDetector.onTouchEvent(ev);
        return super.onTouchEvent(ev);
    } 
 
    @Override 
    public boolean dispatchTouchEvent(MotionEvent ev) {
        if (this.gestureDetector != null && ev.getActionMasked() == MotionEvent.ACTION_DOWN)
            this.gestureDetector.onTouchEvent(ev);
        return super.dispatchTouchEvent(ev);
 
    } 
}