From 22c44c32cc986bf4ae2758499be73dabb20c2ffe Mon Sep 17 00:00:00 2001 From: Bnyro Date: Sun, 19 Nov 2023 09:48:44 +0100 Subject: [PATCH] fix: missing horizontal padding for player in landscape --- .../main/java/com/github/libretube/ui/base/BaseActivity.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/github/libretube/ui/base/BaseActivity.kt b/app/src/main/java/com/github/libretube/ui/base/BaseActivity.kt index db7f010db..9f1bd4793 100644 --- a/app/src/main/java/com/github/libretube/ui/base/BaseActivity.kt +++ b/app/src/main/java/com/github/libretube/ui/base/BaseActivity.kt @@ -30,7 +30,9 @@ open class BaseActivity : AppCompatActivity() { /** * Whether the phone of the user has a cutout like a notch or not */ - var hasCutout = false + val hasCutout by lazy { + WindowHelper.hasCutout(window.decorView.rootView) + } override fun onCreate(savedInstanceState: Bundle?) { // set the app theme (e.g. Material You) @@ -41,8 +43,6 @@ open class BaseActivity : AppCompatActivity() { requestOrientationChange() - hasCutout = WindowHelper.hasCutout(window.decorView) - super.onCreate(savedInstanceState) }