Skip to content

Instantly share code, notes, and snippets.

View leebera33's full-sized avatar
๐Ÿ˜ƒ

SeonghoLee leebera33

๐Ÿ˜ƒ
View GitHub Profile
@leebera33
leebera33 / AndroidMaxScreenSize.java
Last active February 22, 2022 10:08
android max screen size(target API 31)
int width;
int height;
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.R) {
WindowMetrics projectionMetrics = getSystemService(WindowManager.class).getCurrentWindowMetrics();
width = projectionMetrics.getBounds().right;
height = projectionMetrics.getBounds().bottom;
} else {
Display display = getWindowManager().getDefaultDisplay();
Point size = new Point();