List of usage examples for android.graphics Point Point
public Point()
From source file:Main.java
public static final Point getScreenSize(Activity activity) { Display display = activity.getWindowManager().getDefaultDisplay(); Point size = new Point(); display.getSize(size);/*w w w. ja va 2 s . c o m*/ return size; }
From source file:Main.java
public static int calculateImageSize(WindowManager window, int divider) { Display display = window.getDefaultDisplay(); Point resolution = new Point(); display.getSize(resolution);//w w w . j a v a2s . c om int width = resolution.x / divider; int height = resolution.y / divider; return Math.min(width, height); }
From source file:Main.java
/** * Gets device height.// ww w. j a v a 2 s. com * * @return the device height */ public static int getDeviceHeight() { Point p = new Point(); windowManager.getDefaultDisplay().getSize(p); return p.y; }
From source file:Main.java
public static Point getDisplaySize(Display display) { Point size = new Point(); display.getSize(size); return size; }
From source file:Main.java
public static int getScreenWidth(Activity activity) { Display display = activity.getWindowManager().getDefaultDisplay(); Point size = new Point(); int width = 800; if (Build.VERSION.SDK_INT > 13) { display.getSize(size);// w w w .jav a 2 s . c om width = size.x; } else { width = display.getWidth(); } return width; }
From source file:Main.java
public static int getScreenHeight(Activity activity) { Display display = activity.getWindowManager().getDefaultDisplay(); Point size = new Point(); int height = 200; if (Build.VERSION.SDK_INT > 13) { display.getSize(size);/*from w w w.j av a2 s. c o m*/ height = size.y; } else { height = display.getHeight(); } return height; }
From source file:Main.java
public static int GetScreenWidth(Context context) { Display display = ((Activity) context).getWindowManager().getDefaultDisplay(); Point size = new Point(); display.getSize(size);// w w w. j av a 2 s .c o m return size.x; }
From source file:Main.java
public static int GetScreenHeight(Context context) { Display display = ((Activity) context).getWindowManager().getDefaultDisplay(); Point size = new Point(); display.getSize(size);// ww w . ja v a 2 s . c om return size.y; }
From source file:Main.java
public static float getScreenWidth(Context context) { Display display = ((Activity) context).getWindowManager().getDefaultDisplay(); Point size = new Point(); display.getSize(size);/* w w w.j av a 2 s.c om*/ return size.x; }
From source file:Main.java
public static Point getDisplayScreenSize(Activity activity) { Display display = activity.getWindowManager().getDefaultDisplay(); Point size = new Point(); display.getSize(size);// ww w .j a v a2s .c o m return size; }