public boolean onTouchEvent(MotionEvent ev) {
        try {
            mDetector.onTouchEvent(ev);
            return processTouchEvent(ev);
        } catch (IllegalArgumentException e) {
            // Fix for support lib bug, happening when onDestroy is called
            return true;
        }
    }
Does a whole lot of gesture detecting.
main/src/main/java/com/quxianggif/common/view/photoview/CustomGestureDetector.java