mirror of
https://github.com/2009scape/2009Scape-mobile.git
synced 2025-12-20 21:40:15 -07:00
Fixes API compatibility
~~No longer save bytes 😂~~
This commit is contained in:
parent
7eb7b342e1
commit
9f54be3156
1 changed files with 5 additions and 1 deletions
|
|
@ -325,7 +325,11 @@ public final class Tools
|
|||
//For devices with free form/split screen, we need window size, not screen size.
|
||||
displayMetrics = ctx.getResources().getDisplayMetrics();
|
||||
}else{
|
||||
ctx.getDisplay().getRealMetrics(displayMetrics);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||
ctx.getDisplay().getRealMetrics(displayMetrics);
|
||||
} else {
|
||||
displayMetrics = getWindowManager().getDefaultDisplay();
|
||||
}
|
||||
if(!PREF_IGNORE_NOTCH){
|
||||
//Remove notch width when it isn't ignored.
|
||||
displayMetrics.widthPixels -= PREF_NOTCH_SIZE;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue