From ddfc1c425797c192a290c3e7e5769b04d22378e7 Mon Sep 17 00:00:00 2001 From: AlexanderGmach Date: Sat, 6 Aug 2022 11:17:20 +0200 Subject: [PATCH] fix fullscreen on devices with display cutouts --- .../main/java/com/github/libretube/activities/MainActivity.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/com/github/libretube/activities/MainActivity.kt b/app/src/main/java/com/github/libretube/activities/MainActivity.kt index 58317079f..f76f52e82 100644 --- a/app/src/main/java/com/github/libretube/activities/MainActivity.kt +++ b/app/src/main/java/com/github/libretube/activities/MainActivity.kt @@ -442,9 +442,13 @@ class MainActivity : AppCompatActivity() { or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION ) } + + window.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS) } private fun unsetFullscreen() { + window.clearFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { window.attributes.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_DEFAULT