@SuppressLint("ClickableViewAccessibility")
	@Override
	public boolean onTouchEvent(MotionEvent event) {
		// decide if horizontal axis is locked already or we need to check the
		// scrolling direction
		if (!mIsLockOnHorizontalAxis)
			mIsLockOnHorizontalAxis = mGestureDetector.onTouchEvent(event);

		// release the lock when finger is up
		if (event.getAction() == MotionEvent.ACTION_UP)
			mIsLockOnHorizontalAxis = false;

		getParent().requestDisallowInterceptTouchEvent(mIsLockOnHorizontalAxis);
		return super.onTouchEvent(event);
	}
Custom {@link ViewPager} implementation to resolve scroll gesture directions
more accurate than a regular {@link ViewPager} component. This will make it
perfectly usable into a scroll container such as {@link ScrollView},
{@link ListView}, etc.
<p>
Default ViewPager becomes hardly usable when it's nested into a scroll
container. Such container will intercept any touch event with minimal
vertical shift from the child ViewPager. So switch the page by scroll gesture
with a regular {@link ViewPager} nested into a scroll container, user will
need to move his finger horizontally without vertical shift. Which is
obviously quite irritating. {@link SmartViewPager} has a much much better
behavior at resolving scrolling directions.
app/src/main/java/pro/alexzaitsev/freepager/library/view/core/SmartViewPager.java