This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
NewerOlder