Skip to content

Commit 26f1af4

Browse files
authored
Merge pull request #364 from cbalster/fix_crash
Fix crash
2 parents c8f0d7d + 84df9bd commit 26f1af4

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

app/src/main/java/de/stephanlindauer/criticalmaps/Main.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,17 @@ public void onCreate(Bundle bundle) {
111111
// Setup windows inset handling
112112
WindowCompat.setDecorFitsSystemWindows(getWindow(), false);
113113

114+
if (Build.VERSION.SDK_INT >= 28) {
115+
final int newMode = Build.VERSION.SDK_INT >= 30
116+
? WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS
117+
: WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
118+
final WindowManager.LayoutParams attrs = getWindow().getAttributes();
119+
if (attrs.layoutInDisplayCutoutMode != newMode) {
120+
attrs.layoutInDisplayCutoutMode = newMode;
121+
getWindow().setAttributes(attrs);
122+
}
123+
}
124+
114125
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
115126
getWindow().setStatusBarContrastEnforced(false);
116127
getWindow().setNavigationBarContrastEnforced(false);

app/src/main/res/values/styles.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<item name="colorOnSurface">@color/colorOnSurface</item>
2323
<item name="colorError">@color/colorError</item>
2424
<item name="colorOnError">@color/colorOnError</item>
25-
<item name="android:windowLayoutInDisplayCutoutMode" tools:targetApi="27">always</item>
25+
2626
<item name="android:statusBarColor">@android:color/transparent</item>
2727
<item name="android:navigationBarColor">@android:color/transparent</item>
2828
</style>

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ timber = "5.0.1"
77
okhttp = "5.3.2"
88
typedPreferences = "2.1.0"
99
material = "1.13.0"
10-
core = "1.17.0"
10+
core = "1.18.0"
1111
appcompat = "1.7.1"
1212
annotation = "1.9.1"
1313
exifinterface = "1.4.2"

0 commit comments

Comments
 (0)