Code example for Rect

Methods: containsset

0
 
			} 
		} 
 
		private boolean isEventWithinView(MotionEvent e, View child) { 
            Rect viewRect = new Rect(); 
            int[] childPosition = new int[2]; 
            child.getLocationOnScreen(childPosition); 
            int left = childPosition[0]; 
            int right = left + child.getWidth(); 
            int top = childPosition[1]; 
            int bottom = top + child.getHeight(); 
            viewRect.set(left, top, right, bottom); 
            return viewRect.contains((int) e.getRawX(), (int) e.getRawY()); 
        } 
	}; 
 
	 
 
}