public static boolean isPointInsideView ( float x , float y , View view ) { int location [ ] = new int [ 2 ] ; view . getLocationOnScreen ( location ) ; int viewX = location [ 0 ] ; int viewY = location [ 1 ] ; //point is inside view bounds if ( ( viewX < x && x < ( viewX + view . getWidth ( ) ) ) && ( viewY < y && y < ( viewY + view . getHeight ( ) ) ) ) { return true ; } else { return false ; } }
Determines if given points are inside view