mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 16:30:31 +05:30
fix: no horizontal padding in fullscreen player
This commit is contained in:
parent
152012b440
commit
b74fa0e463
@ -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> {
|
||||
|
Loading…
x
Reference in New Issue
Block a user