List of usage examples for android.graphics Point Point
public Point()
From source file:Main.java
public static Point getScreenSize(Context paramContext) { Display localDisplay = ((WindowManager) paramContext.getSystemService("window")).getDefaultDisplay(); Point localPoint = new Point(); localDisplay.getSize(localPoint);//from w w w. j a v a 2s . c o m return localPoint; }
From source file:Main.java
@SuppressWarnings("deprecation") public static int getScreenHeight(Activity activity) { int Measuredheight = 0; Point size = new Point(); WindowManager wm = activity.getWindowManager(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { wm.getDefaultDisplay().getSize(size); Measuredheight = size.y;//w w w . j a va 2s .c om } else { Display d = wm.getDefaultDisplay(); Measuredheight = d.getWidth(); } return Measuredheight; }
From source file:Main.java
public static float getScreenWidth(Activity activity) { if (mScreenWidth == 0) { Point size = new Point(); activity.getWindowManager().getDefaultDisplay().getSize(size); mScreenWidth = size.x;/*from ww w.j a va 2 s . co m*/ Log.d(TAG, "screen size is " + size); } return mScreenWidth; }
From source file:Main.java
/*** * Get the device screen width//from w ww .j a v a 2 s .c o m * * @param context * @return int */ public static int getScreenWidth(@NonNull Context context) { Point size = new Point(); ((Activity) context).getWindowManager().getDefaultDisplay().getSize(size); return size.x; }
From source file:Main.java
public static Point getDisplaySize(Activity context) { Display display = context.getWindowManager().getDefaultDisplay(); final Point point = new Point(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { display.getSize(point);//from ww w. j av a2 s . c om } else { point.x = display.getWidth(); point.y = display.getHeight(); } return point; }
From source file:Main.java
public static Point getScreenSize(Context context) { WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); Display display = wm.getDefaultDisplay(); Point size = new Point(); display.getSize(size);//from w w w . j a va 2s . co m return size; }
From source file:Main.java
private static Point getDisplaySize(Activity activity) { Display display = activity.getWindowManager().getDefaultDisplay(); Point size = new Point(); display.getSize(size);//w w w .ja va 2 s. co m return size; }
From source file:Main.java
public static Point getDisplaySize(Context context) { WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); Display display = wm.getDefaultDisplay(); Point size = new Point(); display.getSize(size);/*from w w w .j a v a 2s . co m*/ int width = size.x; int height = size.y; return new Point(width, height); }
From source file:Main.java
@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2) public static int getScreenWidth(Activity screen) { Display display = screen.getWindowManager().getDefaultDisplay(); Point size = new Point(); display.getSize(size);/*from w w w. ja v a 2 s. co m*/ return size.x; }
From source file:Main.java
@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2) public static int getScreenHeight(Activity screen) { Display display = screen.getWindowManager().getDefaultDisplay(); Point size = new Point(); display.getSize(size);//from w w w.jav a 2s .com return size.y; }