mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-05-17 15:32:01 +00:00
ref: add submit intro button to top player controls
This commit is contained in:
parent
a36e927c0b
commit
06553b9b26
1 changed files with 14 additions and 9 deletions
|
|
@ -131,6 +131,7 @@ internal fun PlayerControlsShell(
|
||||||
episodeTitle = episodeTitle,
|
episodeTitle = episodeTitle,
|
||||||
metrics = metrics,
|
metrics = metrics,
|
||||||
isLocked = isLocked,
|
isLocked = isLocked,
|
||||||
|
onSubmitIntroClick = onSubmitIntroClick,
|
||||||
onLockToggle = onLockToggle,
|
onLockToggle = onLockToggle,
|
||||||
onBack = onBack,
|
onBack = onBack,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
|
|
@ -168,7 +169,6 @@ internal fun PlayerControlsShell(
|
||||||
onAudioClick = onAudioClick,
|
onAudioClick = onAudioClick,
|
||||||
onSourcesClick = onSourcesClick,
|
onSourcesClick = onSourcesClick,
|
||||||
onEpisodesClick = onEpisodesClick,
|
onEpisodesClick = onEpisodesClick,
|
||||||
onSubmitIntroClick = onSubmitIntroClick,
|
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.align(Alignment.BottomCenter)
|
.align(Alignment.BottomCenter)
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
|
|
@ -189,6 +189,7 @@ private fun PlayerHeader(
|
||||||
episodeTitle: String?,
|
episodeTitle: String?,
|
||||||
metrics: PlayerLayoutMetrics,
|
metrics: PlayerLayoutMetrics,
|
||||||
isLocked: Boolean,
|
isLocked: Boolean,
|
||||||
|
onSubmitIntroClick: (() -> Unit)?,
|
||||||
onLockToggle: () -> Unit,
|
onLockToggle: () -> Unit,
|
||||||
onBack: () -> Unit,
|
onBack: () -> Unit,
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
|
|
@ -264,6 +265,15 @@ private fun PlayerHeader(
|
||||||
horizontalArrangement = Arrangement.spacedBy(10.dp),
|
horizontalArrangement = Arrangement.spacedBy(10.dp),
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
) {
|
) {
|
||||||
|
if (onSubmitIntroClick != null) {
|
||||||
|
PlayerHeaderIconButton(
|
||||||
|
icon = Icons.Rounded.Flag,
|
||||||
|
contentDescription = "Submit Intro",
|
||||||
|
buttonSize = metrics.headerIconSize + 16.dp,
|
||||||
|
iconSize = metrics.headerIconSize,
|
||||||
|
onClick = onSubmitIntroClick,
|
||||||
|
)
|
||||||
|
}
|
||||||
PlayerHeaderIconButton(
|
PlayerHeaderIconButton(
|
||||||
icon = if (isLocked) Icons.Rounded.LockOpen else Icons.Rounded.Lock,
|
icon = if (isLocked) Icons.Rounded.LockOpen else Icons.Rounded.Lock,
|
||||||
contentDescription = if (isLocked) {
|
contentDescription = if (isLocked) {
|
||||||
|
|
@ -424,7 +434,6 @@ private fun ProgressControls(
|
||||||
onAudioClick: () -> Unit,
|
onAudioClick: () -> Unit,
|
||||||
onSourcesClick: (() -> Unit)? = null,
|
onSourcesClick: (() -> Unit)? = null,
|
||||||
onEpisodesClick: (() -> Unit)? = null,
|
onEpisodesClick: (() -> Unit)? = null,
|
||||||
onSubmitIntroClick: (() -> Unit)? = null,
|
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
) {
|
) {
|
||||||
val durationMs = playbackSnapshot.durationMs.coerceAtLeast(1L)
|
val durationMs = playbackSnapshot.durationMs.coerceAtLeast(1L)
|
||||||
|
|
@ -506,13 +515,6 @@ private fun ProgressControls(
|
||||||
onClick = onEpisodesClick,
|
onClick = onEpisodesClick,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
if (onSubmitIntroClick != null) {
|
|
||||||
PlayerActionPillButton(
|
|
||||||
label = "Submit Intro",
|
|
||||||
icon = Icons.Rounded.Flag,
|
|
||||||
onClick = onSubmitIntroClick,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -676,6 +678,9 @@ private fun PlayerActionPillButton(
|
||||||
text = label,
|
text = label,
|
||||||
style = MaterialTheme.nuvioTypeScale.labelSm,
|
style = MaterialTheme.nuvioTypeScale.labelSm,
|
||||||
color = Color.White,
|
color = Color.White,
|
||||||
|
maxLines = 1,
|
||||||
|
overflow = TextOverflow.Ellipsis,
|
||||||
|
softWrap = false,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue