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 ; }
Maps a point to a position in the list .