Code example for ShapeDrawable

Methods: getBounds

0
		} 
	} 
	 
	@Override 
	public boolean onTouchEvent(MotionEvent event) {
		final Rect r = mBar.getBounds();
		final int newX = (int)event.getX();
		final int newY = (int)event.getY();
		final int coverBottom = Math.min(r.bottom, Math.max(r.top, newY));
		final int coverRight = Math.min(r.right, Math.max(r.left, newX));
		final int action = event.getAction();
		 
		// begin of touch event, check if touch was in range 
		if(MotionEvent.ACTION_DOWN == action) {
			mEmbraceTouch = (r.left <= newX && newX <= r.right);
		} 
		 
		// we can ignore all further touch events 
		if(!mEmbraceTouch) {
			return false; 
		}