Code example for Rect

Methods: getWindowVisibleDisplayFrame

0
	public static boolean isTouchLeft(MotionEvent e) {
		return (e.getX() < (dm.widthPixels / 2));
	} 
 
	public static int getStatusbarHeight(Activity activity) {
		Rect frame = new Rect();
		activity.getWindow().getDecorView().getWindowVisibleDisplayFrame(frame);
		return frame.top;
	} 
 
	public static void setActivitySizePos(Activity activity, int x, int y,
			int width, int height) {
		WindowManager.LayoutParams p = activity.getWindow().getAttributes();
		p.x = x;
		p.y = y;
		p.width = width;
		p.height = height;
		activity.getWindow().setAttributes(p);
	} 
 
	public static int dipToPx(int dip) {