-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathUtils.java
More file actions
34 lines (29 loc) · 929 Bytes
/
Copy pathUtils.java
File metadata and controls
34 lines (29 loc) · 929 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package com.rahul.bounce;
import android.app.Activity;
import android.graphics.Point;
import android.os.Build;
import android.view.Display;
import android.view.View;
/**
* Created by workhard on 9/25/15.
*/
public class Utils {
public static int getScreenWidth(Activity activity) {
Display display = activity.getWindowManager().getDefaultDisplay();
Point size = new Point();
display.getSize(size);
int width = size.x;
return width;
}
public static int getScreenHeight(Activity activity) {
Display display = activity.getWindowManager().getDefaultDisplay();
Point size = new Point();
display.getSize(size);
int height = size.y;
return height;
}
public static void setElevation(View view, float elevation) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
view.setElevation(elevation);
}
}