Merge pull request #5200 from saymanrifat/saymanrifat-5095-subtitle-optz

fix: increase subtitle font size in fullscreen
This commit is contained in:
Bnyro 2023-11-19 10:58:46 +01:00 committed by GitHub
commit d3d0cc917a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -692,16 +692,26 @@ open class CustomExoPlayerView(
}
override fun onFullscreenChange(isFullscreen: Boolean) {
if (PlayerHelper.swipeGestureEnabled && this::brightnessHelper.isInitialized) {
if (isFullscreen) {
if (PlayerHelper.swipeGestureEnabled && this::brightnessHelper.isInitialized) {
brightnessHelper.restoreSavedBrightness()
}
subtitleView?.setFixedTextSize(
Cue.TEXT_SIZE_TYPE_ABSOLUTE,
PlayerHelper.captionsTextSize * 1.5f
)
if (resizeMode == AspectRatioFrameLayout.RESIZE_MODE_ZOOM) {
subtitleView?.setBottomPaddingFraction(SUBTITLE_BOTTOM_PADDING_FRACTION)
}
} else {
if (PlayerHelper.swipeGestureEnabled && this::brightnessHelper.isInitialized) {
brightnessHelper.resetToSystemBrightness(false)
subtitleView?.setBottomPaddingFraction(SubtitleView.DEFAULT_BOTTOM_PADDING_FRACTION)
}
subtitleView?.setFixedTextSize(
Cue.TEXT_SIZE_TYPE_ABSOLUTE,
PlayerHelper.captionsTextSize
)
subtitleView?.setBottomPaddingFraction(SubtitleView.DEFAULT_BOTTOM_PADDING_FRACTION)
}
}