TouchUtil

	public static boolean youClickHere(MotionEvent event, double x0, double y0, double width, double height)
	{
		double x = event.getX();
		double y = event.getY();
		if (x < x0 || x > x0 + width)
			return false;
		if (y < y0 || y > y0 + height)
			return false;
		return true;
	}

	public static boolean youAreHere(double x, double y, double x0, double y0, int width, int height)
	{
		if (x < x0 || x > x0 + width)
			return false;
		if (y < y0 || y > y0 + height)
			return false;
		return true;
	}

 

你可能感兴趣的:(touch)