mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-08 15:50:16 +02:00
Show subtitles even when controller is visible (#28)
Closes #20 Show subtitles slightly smaller and higher when the controls are visible This needs to be revisited when custom subtitle styling is implemented (#11).
This commit is contained in:
parent
e0772ed9b8
commit
7f93262d06
1 changed files with 24 additions and 22 deletions
|
|
@ -260,6 +260,30 @@ fun PlaybackPage(
|
|||
}
|
||||
}
|
||||
|
||||
// Subtitles
|
||||
if (skipIndicatorDuration == 0L && currentItemPlayback.subtitleIndexEnabled) {
|
||||
val maxSize by animateFloatAsState(if (controllerViewState.controlsVisible) .7f else 1f)
|
||||
AndroidView(
|
||||
factory = { context ->
|
||||
SubtitleView(context).apply {
|
||||
setUserDefaultStyle()
|
||||
setUserDefaultTextSize()
|
||||
}
|
||||
},
|
||||
update = {
|
||||
it.setCues(cues)
|
||||
},
|
||||
onReset = {
|
||||
it.setCues(null)
|
||||
},
|
||||
modifier =
|
||||
Modifier
|
||||
.fillMaxSize(maxSize)
|
||||
.align(Alignment.TopCenter)
|
||||
.background(Color.Transparent),
|
||||
)
|
||||
}
|
||||
|
||||
// The playback controls
|
||||
AnimatedVisibility(
|
||||
controllerViewState.controlsVisible,
|
||||
|
|
@ -343,28 +367,6 @@ fun PlaybackPage(
|
|||
)
|
||||
}
|
||||
|
||||
// Subtitles
|
||||
if (!controllerViewState.controlsVisible && skipIndicatorDuration == 0L && currentItemPlayback.subtitleIndexEnabled) {
|
||||
AndroidView(
|
||||
factory = { context ->
|
||||
SubtitleView(context).apply {
|
||||
setUserDefaultStyle()
|
||||
setUserDefaultTextSize()
|
||||
}
|
||||
},
|
||||
update = {
|
||||
it.setCues(cues)
|
||||
},
|
||||
onReset = {
|
||||
it.setCues(null)
|
||||
},
|
||||
modifier =
|
||||
Modifier
|
||||
.fillMaxSize()
|
||||
.background(Color.Transparent),
|
||||
)
|
||||
}
|
||||
|
||||
// Ask to skip intros, etc button
|
||||
AnimatedVisibility(
|
||||
showSegment,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue