fix: no horizontal padding in fullscreen player

This commit is contained in:
Bnyro 2024-10-02 12:06:07 +02:00
parent 152012b440
commit b74fa0e463

View File

@ -659,9 +659,11 @@ abstract class CustomExoPlayerView(
if (!activity.hasCutout && binding.topBar.marginStart == LANDSCAPE_MARGIN_HORIZONTAL_NONE) return
// add a margin to the top and the bottom bar in landscape mode for notches
val isInPortrait = resources.configuration.orientation == Configuration.ORIENTATION_PORTRAIT
val isForcedLandscape =
activity.requestedOrientation == ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE
val isInLandscape = resources.configuration.orientation == Configuration.ORIENTATION_LANDSCAPE
val horizontalMargin =
if (isFullscreen() && !isInPortrait) LANDSCAPE_MARGIN_HORIZONTAL else LANDSCAPE_MARGIN_HORIZONTAL_NONE
if (isFullscreen() && (isInLandscape || isForcedLandscape)) LANDSCAPE_MARGIN_HORIZONTAL else LANDSCAPE_MARGIN_HORIZONTAL_NONE
listOf(binding.topBar, binding.bottomBar).forEach {
it.updateLayoutParams<MarginLayoutParams> {