From 545749434013ee957a4a234f6b41b33ebbe7a3dc Mon Sep 17 00:00:00 2001 From: Krunal Patel Date: Tue, 6 Dec 2022 14:20:56 +0530 Subject: [PATCH] Use constant for subtitle padding fraction --- .../com/github/libretube/ui/views/CustomExoPlayerView.kt | 8 ++++++-- 1 file changed, 6 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 71bf0e8e6..fd8b3fce4 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 @@ -514,7 +514,7 @@ internal class CustomExoPlayerView( resizeMode = AspectRatioFrameLayout.RESIZE_MODE_ZOOM if (resources.configuration.orientation == Configuration.ORIENTATION_LANDSCAPE) { - subtitleView?.setBottomPaddingFraction(0.158f) + subtitleView?.setBottomPaddingFraction(SUBTITLE_BOTTOM_PADDING_FRACTION) } } @@ -529,7 +529,7 @@ internal class CustomExoPlayerView( if (isFullscreen) { brightnessHelper.restoreSavedBrightness() if (resizeMode == AspectRatioFrameLayout.RESIZE_MODE_ZOOM) { - subtitleView?.setBottomPaddingFraction(0.158f) + subtitleView?.setBottomPaddingFraction(SUBTITLE_BOTTOM_PADDING_FRACTION) } } else { brightnessHelper.resetToSystemBrightness(false) @@ -537,4 +537,8 @@ internal class CustomExoPlayerView( } } } + + companion object { + private const val SUBTITLE_BOTTOM_PADDING_FRACTION = 0.158f + } }