Fix shrinked player layout after PiP (#3342)

* Fix shrinked player layout after PiP
This commit is contained in:
Bnyro 2023-03-22 11:14:54 +01:00 committed by GitHub
parent 3eb1a3805e
commit 17ae715d32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,6 +17,7 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import androidx.core.os.postDelayed import androidx.core.os.postDelayed
import androidx.core.view.ViewCompat import androidx.core.view.ViewCompat
import androidx.core.view.marginStart
import androidx.core.view.updateLayoutParams import androidx.core.view.updateLayoutParams
import androidx.lifecycle.LifecycleOwner import androidx.lifecycle.LifecycleOwner
import com.github.libretube.R import com.github.libretube.R
@ -594,7 +595,8 @@ internal class CustomExoPlayerView(
updateTopBarMargin() updateTopBarMargin()
// don't add extra padding if there's no cutout // 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 // add a margin to the top and the bottom bar in landscape mode for notches
val newMargin = when (newConfig?.orientation) { val newMargin = when (newConfig?.orientation) {