mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-05-17 15:32:01 +00:00
Merge branch 'cmp-rewrite' into desktop
This commit is contained in:
commit
b30ad31b37
1 changed files with 27 additions and 2 deletions
|
|
@ -38,7 +38,6 @@ import androidx.compose.ui.unit.Dp
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
import coil3.compose.AsyncImage
|
import coil3.compose.AsyncImage
|
||||||
import com.nuvio.app.core.ui.localizedContinueWatchingSubtitle
|
|
||||||
import com.nuvio.app.core.ui.NuvioProgressBar
|
import com.nuvio.app.core.ui.NuvioProgressBar
|
||||||
import com.nuvio.app.core.ui.NuvioShelfSection
|
import com.nuvio.app.core.ui.NuvioShelfSection
|
||||||
import com.nuvio.app.core.ui.nuvioSecondaryClick
|
import com.nuvio.app.core.ui.nuvioSecondaryClick
|
||||||
|
|
@ -52,6 +51,19 @@ import org.jetbrains.compose.resources.stringResource
|
||||||
private fun continueWatchingProgressPercent(progressFraction: Float): Int =
|
private fun continueWatchingProgressPercent(progressFraction: Float): Int =
|
||||||
(progressFraction * 100f).roundToInt().coerceIn(1, 99)
|
(progressFraction * 100f).roundToInt().coerceIn(1, 99)
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
private fun localizedContinueWatchingMetaLine(item: ContinueWatchingItem): String =
|
||||||
|
when {
|
||||||
|
item.seasonNumber != null && item.episodeNumber != null && item.isNextUp ->
|
||||||
|
stringResource(Res.string.continue_watching_up_next_episode, item.seasonNumber, item.episodeNumber)
|
||||||
|
item.seasonNumber != null && item.episodeNumber != null ->
|
||||||
|
stringResource(Res.string.compose_player_episode_code_full, item.seasonNumber, item.episodeNumber)
|
||||||
|
item.isNextUp ->
|
||||||
|
stringResource(Res.string.continue_watching_up_next)
|
||||||
|
else ->
|
||||||
|
stringResource(Res.string.media_movie)
|
||||||
|
}
|
||||||
|
|
||||||
private fun ContinueWatchingItem.continueWatchingArtworkUrl(
|
private fun ContinueWatchingItem.continueWatchingArtworkUrl(
|
||||||
useEpisodeThumbnails: Boolean,
|
useEpisodeThumbnails: Boolean,
|
||||||
): String? = when {
|
): String? = when {
|
||||||
|
|
@ -357,7 +369,8 @@ private fun ContinueWatchingWideCard(
|
||||||
.padding(layout.wideContentPadding),
|
.padding(layout.wideContentPadding),
|
||||||
verticalArrangement = Arrangement.SpaceBetween,
|
verticalArrangement = Arrangement.SpaceBetween,
|
||||||
) {
|
) {
|
||||||
val wideMetaLine = localizedContinueWatchingSubtitle(item)
|
val wideMetaLine = localizedContinueWatchingMetaLine(item)
|
||||||
|
val episodeTitle = item.episodeTitle?.trim()?.takeIf { it.isNotBlank() }
|
||||||
Column(verticalArrangement = Arrangement.spacedBy(6.dp)) {
|
Column(verticalArrangement = Arrangement.spacedBy(6.dp)) {
|
||||||
Row(
|
Row(
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
|
|
@ -389,6 +402,18 @@ private fun ContinueWatchingWideCard(
|
||||||
maxLines = 1,
|
maxLines = 1,
|
||||||
overflow = TextOverflow.Ellipsis,
|
overflow = TextOverflow.Ellipsis,
|
||||||
)
|
)
|
||||||
|
if (episodeTitle != null) {
|
||||||
|
Text(
|
||||||
|
text = episodeTitle,
|
||||||
|
style = MaterialTheme.typography.bodySmall.copy(
|
||||||
|
fontSize = layout.wideMetaSize,
|
||||||
|
fontWeight = FontWeight.Medium,
|
||||||
|
),
|
||||||
|
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||||
|
maxLines = 1,
|
||||||
|
overflow = TextOverflow.Ellipsis,
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.progressFraction > 0f) {
|
if (item.progressFraction > 0f) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue