mirror of
https://github.com/bbara04/Purefin.git
synced 2026-07-23 19:26:50 +00:00
feat(series): show season/episode context on play button and truncate subtitle
Enhance the series play button to display season and episode number alongside the play label when a next-up episode is available. Also constrain the subtitle text to a single line with ellipsis overflow to prevent layout issues from long subtitle strings.
This commit is contained in:
@@ -220,6 +220,8 @@ private fun ColumnScope.MediaDetailScaffoldContent(
|
||||
color = scheme.onBackground,
|
||||
fontSize = uiModel.subtitleFontSize,
|
||||
fontWeight = uiModel.subtitleFontWeight,
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
modifier = modifier
|
||||
)
|
||||
}
|
||||
|
||||
@@ -250,9 +250,14 @@ private fun Series.toMediaDetailScaffoldUiModel(
|
||||
metadataItems = listOf(year, "$seasonCount Seasons"),
|
||||
actions = selectedSeason?.let {
|
||||
val seriesWatched = unwatchedEpisodeCount == 0
|
||||
val playButtonText = mediaPlayButtonText(nextUpEpisode?.progress, nextUpEpisode?.watched)
|
||||
MediaDetailActionsUiModel(
|
||||
primaryAction = MediaDetailPrimaryActionUiModel(
|
||||
text = mediaPlayButtonText(nextUpEpisode?.progress, nextUpEpisode?.watched),
|
||||
text = if (nextUpEpisode != null) {
|
||||
"$playButtonText S${it.index} • E${nextUpEpisode.index}"
|
||||
} else {
|
||||
playButtonText
|
||||
},
|
||||
progress = mediaPlaybackProgress(nextUpEpisode?.progress),
|
||||
onClick = onPlayClick,
|
||||
testTag = SeriesPlayButtonTag
|
||||
|
||||
Reference in New Issue
Block a user