code: private boolean isScrollingHorizontal(float x1, float y1, float x2, float y2) {
          float deltaX = x2 - x1;
          float deltaY = y2 - y1;
  
          if (Math.abs(deltaX) > mTouchSlop &&
                  Math.abs(deltaX) > Math.abs(deltaY)) {
  
              return true;
          }
  
          return false;
      }
docs: Determine whether the distance between the user's ACTION_DOWN
  event (x1, y1) and the current ACTION_MOVE event (x2, y2) should
  be interpreted as a horizontal swipe.
  
  @param x1
  @param y1
  @param x2
  @param y2
  @return