@Override public boolean onTouchEvent(MotionEvent ev) {
    final int action = ev.getAction();
    if (action != MotionEvent.ACTION_DOWN && mIgnoreTap) {
      return false;
    }

    // Any tap within touch slop to either side of the current item
    // will scroll to prev/next.
    final float x = ev.getX();
    final float y = ev.getY();
    switch (action) {
      case MotionEvent.ACTION_DOWN:
        mInitialMotionX = x;
        mInitialMotionY = y;
        mIgnoreTap = false;
        break;

      case MotionEvent.ACTION_MOVE:
        if (Math.abs(x - mInitialMotionX) > mTouchSlop
            || Math.abs(y - mInitialMotionY) > mTouchSlop) {
          mIgnoreTap = true;
        }
        break;

      case MotionEvent.ACTION_UP:
        if (x < mCurrText.getLeft() - mTabPadding) {
          mPager.setCurrentItem(mPager.getCurrentItem() - 1);
        } else if (x > mCurrText.getRight() + mTabPadding) {
          mPager.setCurrentItem(mPager.getCurrentItem() + 1);
        }
      default:
        break;
    }

    return true;
  }
Return whether or not this tab strip will draw a full-width underline.
This defaults to true if no background is set.

@return true if this tab strip will draw a full-width underline in the
current tab indicator color.
sample/src/main/java/android/support/v4/view/PagerTabStripV22.java