code: public int pointToPosition(int x, int y) {
          Rect frame = mTouchFrame;
          if (frame == null) {
              mTouchFrame = new Rect();
              frame = mTouchFrame;
          }
  
          final int count = getChildCount();
          for (int i = count - 1; i >= 0; i--) {
              View child = getChildAt(i);
              if (child.getVisibility() == View.VISIBLE) {
                  child.getHitRect(frame);
                  if (frame.contains(x, y)) {
                      return mFirstPosition + i;
                  }
              }
          }
          return INVALID_POSITION;
      }
docs: Maps a point to a position in the list.
  
  @param x X in local coordinate
  @param y Y in local coordinate
  @return The position of the item which contains the specified point, or
  {@link #INVALID_POSITION} if the point does not intersect an item.