@Override
	public boolean onInterceptTouchEvent(MotionEvent ev) {
		if (!mIsPagingEnabled)
			return false;

		// Log.d(TAG, "onInterceptTouchEvent::action=" + ev.getAction());

		/*
		 * This method JUST determines whether we want to intercept the motion.
		 * If we return true, onTouchEvent will be called and we do the actual
		 * scrolling there.
		 */

		/*
		 * Shortcut the most recurring case: the user is in the dragging state
		 * and he is moving his finger. We want to intercept this motion.
		 */
		final int action = ev.getAction();
		if ((action == MotionEvent.ACTION_MOVE)
				&& (mTouchState != TOUCH_STATE_REST)) {
			// Log.d(TAG, "onInterceptTouchEvent::shortcut=true");
			return true;
		}

		final float y = ev.getY();
		final float x = ev.getX();

		switch (action) {
		case MotionEvent.ACTION_MOVE:
			/*
			 * mIsBeingDragged == false, otherwise the shortcut would have
			 * caught it. Check whether the user has moved far enough from his
			 * original down touch.
			 */
			if (mTouchState == TOUCH_STATE_REST) {
				checkStartScroll(x, y);
			}

			break;

		case MotionEvent.ACTION_DOWN:
			// Remember location of down touch
			mLastMotionX = x;
			mLastMotionY = y;
			mAllowLongPress = true;

			/*
			 * If being flinged and user touches the screen, initiate drag;
			 * otherwise don't. mScroller.isFinished should be false when being
			 * flinged.
			 */
			mTouchState = mScroller.isFinished() ? TOUCH_STATE_REST
					: TOUCH_STATE_SCROLLING;
			break;

		case MotionEvent.ACTION_CANCEL:
		case MotionEvent.ACTION_UP:
			// Release the drag
			clearChildrenCache();
			mTouchState = TOUCH_STATE_REST;
			break;
		}

		/*
		 * The only time we want to intercept motion events is if we are in the
		 * drag mode.
		 */
		return mTouchState != TOUCH_STATE_REST;
	}
Gets the value that getScrollX() should return if the specified page is
the current page (and no other scrolling is occurring). Use this to pass
a value to scrollTo(), for example.

@param whichPage
@return
app/src/main/java/pro/alexzaitsev/freepager/library/view/core/VerticalPager.java