From 17ae715d3271466530831244679bbf9de378a262 Mon Sep 17 00:00:00 2001 From: Bnyro <82752168+Bnyro@users.noreply.github.com> Date: Wed, 22 Mar 2023 11:14:54 +0100 Subject: [PATCH] Fix shrinked player layout after PiP (#3342) * Fix shrinked player layout after PiP --- .../java/com/github/libretube/ui/views/CustomExoPlayerView.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/github/libretube/ui/views/CustomExoPlayerView.kt b/app/src/main/java/com/github/libretube/ui/views/CustomExoPlayerView.kt index 1d85feb25..09e661e0a 100644 --- a/app/src/main/java/com/github/libretube/ui/views/CustomExoPlayerView.kt +++ b/app/src/main/java/com/github/libretube/ui/views/CustomExoPlayerView.kt @@ -17,6 +17,7 @@ import androidx.appcompat.app.AppCompatActivity import androidx.core.content.ContextCompat import androidx.core.os.postDelayed import androidx.core.view.ViewCompat +import androidx.core.view.marginStart import androidx.core.view.updateLayoutParams import androidx.lifecycle.LifecycleOwner import com.github.libretube.R @@ -594,7 +595,8 @@ internal class CustomExoPlayerView( updateTopBarMargin() // don't add extra padding if there's no cutout - if (ViewCompat.getRootWindowInsets(this)?.displayCutout == null) return + val hasCutout = ViewCompat.getRootWindowInsets(this)?.displayCutout != null + if (!hasCutout && binding.topBar.marginStart == 0) return // add a margin to the top and the bottom bar in landscape mode for notches val newMargin = when (newConfig?.orientation) {