+ 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
+ }