- val displayUnderCutouts = sharedPreferences.getBoolean(getString(R.string.display_under_cutouts_key), false)
-
- // Display under cutouts if specified. This must be done here as it doesn't appear to work correctly if handled after the app is fully initialized.
- if (displayUnderCutouts) {
- if (Build.VERSION.SDK_INT >= 30)
- window.attributes.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS
- else if (Build.VERSION.SDK_INT >= 28)
- window.attributes.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
+
+ // Displaying under cutouts currently only works on API < 35. <https://redmine.stoutner.com/issues/1238>
+ if (Build.VERSION.SDK_INT < 35) {
+ // Get the display under cutouts preference.
+ displayUnderCutouts = sharedPreferences.getBoolean(getString(R.string.display_under_cutouts_key), false)
+
+ // Set the display under cutouts mode. This must be done here as it doesn't appear to work correctly if handled after the app is fully initialized.
+ if (displayUnderCutouts) {
+ if (Build.VERSION.SDK_INT >= 30)
+ window.attributes.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS
+ else if (Build.VERSION.SDK_INT >= 28)
+ window.attributes.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
+ }