mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-05-16 23:12:12 +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,
|
||||
metrics = metrics,
|
||||
isLocked = isLocked,
|
||||
onSubmitIntroClick = onSubmitIntroClick,
|
||||
onLockToggle = onLockToggle,
|
||||
onBack = onBack,
|
||||
modifier = Modifier
|
||||
|
|
@ -168,7 +169,6 @@ internal fun PlayerControlsShell(
|
|||
onAudioClick = onAudioClick,
|
||||
onSourcesClick = onSourcesClick,
|
||||
onEpisodesClick = onEpisodesClick,
|
||||
onSubmitIntroClick = onSubmitIntroClick,
|
||||
modifier = Modifier
|
||||
.align(Alignment.BottomCenter)
|
||||
.fillMaxWidth()
|
||||
|
|
@ -189,6 +189,7 @@ private fun PlayerHeader(
|
|||
episodeTitle: String?,
|
||||
metrics: PlayerLayoutMetrics,
|
||||
isLocked: Boolean,
|
||||
onSubmitIntroClick: (() -> Unit)?,
|
||||
onLockToggle: () -> Unit,
|
||||
onBack: () -> Unit,
|
||||
modifier: Modifier = Modifier,
|
||||
|
|
@ -264,6 +265,15 @@ private fun PlayerHeader(
|
|||
horizontalArrangement = Arrangement.spacedBy(10.dp),
|
||||
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(
|
||||
icon = if (isLocked) Icons.Rounded.LockOpen else Icons.Rounded.Lock,
|
||||
contentDescription = if (isLocked) {
|
||||
|
|
@ -424,7 +434,6 @@ private fun ProgressControls(
|
|||
onAudioClick: () -> Unit,
|
||||
onSourcesClick: (() -> Unit)? = null,
|
||||
onEpisodesClick: (() -> Unit)? = null,
|
||||
onSubmitIntroClick: (() -> Unit)? = null,
|
||||
modifier: Modifier = Modifier,
|
||||
) {
|
||||
val durationMs = playbackSnapshot.durationMs.coerceAtLeast(1L)
|
||||
|
|
@ -506,13 +515,6 @@ private fun ProgressControls(
|
|||
onClick = onEpisodesClick,
|
||||
)
|
||||
}
|
||||
if (onSubmitIntroClick != null) {
|
||||
PlayerActionPillButton(
|
||||
label = "Submit Intro",
|
||||
icon = Icons.Rounded.Flag,
|
||||
onClick = onSubmitIntroClick,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -676,6 +678,9 @@ private fun PlayerActionPillButton(
|
|||
text = label,
|
||||
style = MaterialTheme.nuvioTypeScale.labelSm,
|
||||
color = Color.White,
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
softWrap = false,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue