From b74fa0e463e5e1a6a66dcc72f7bd0f35b459adab Mon Sep 17 00:00:00 2001 From: Bnyro Date: Wed, 2 Oct 2024 12:06:07 +0200 Subject: [PATCH] fix: no horizontal padding in fullscreen player --- .../com/github/libretube/ui/views/CustomExoPlayerView.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 82274906c7..8fcfa42c7e 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 @@ -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 {