mirror of
https://github.com/bbara04/Purefin.git
synced 2026-07-24 03:36:51 +00:00
refactor(tv): move skip button to the TvPlayerControlsOverlay panel
This commit is contained in:
@@ -6,7 +6,6 @@ import androidx.compose.animation.fadeIn
|
|||||||
import androidx.compose.animation.fadeOut
|
import androidx.compose.animation.fadeOut
|
||||||
import androidx.compose.animation.shrinkVertically
|
import androidx.compose.animation.shrinkVertically
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.clickable
|
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
@@ -218,52 +217,16 @@ private fun TvPlayerBottomSection(
|
|||||||
horizontalArrangement = Arrangement.SpaceBetween,
|
horizontalArrangement = Arrangement.SpaceBetween,
|
||||||
verticalAlignment = Alignment.CenterVertically
|
verticalAlignment = Alignment.CenterVertically
|
||||||
) {
|
) {
|
||||||
if (uiState.activeSkippableSegmentEndMs != null) {
|
|
||||||
Row(
|
|
||||||
modifier = Modifier
|
|
||||||
.fillMaxWidth()
|
|
||||||
.padding(horizontal = 4.dp),
|
|
||||||
horizontalArrangement = Arrangement.End
|
|
||||||
) {
|
|
||||||
TvIconButton(
|
|
||||||
icon = Icons.Outlined.SkipNext,
|
|
||||||
contentDescription = "Skip segment",
|
|
||||||
onClick = onSkipSegment,
|
|
||||||
size = 64,
|
|
||||||
label = "Skip",
|
|
||||||
modifier = expandPlaylistModifier
|
|
||||||
)
|
|
||||||
}
|
|
||||||
Spacer(modifier = Modifier.height(6.dp))
|
|
||||||
}
|
|
||||||
Text(
|
Text(
|
||||||
text = formatTime(uiState.positionMs),
|
text = formatTime(uiState.positionMs),
|
||||||
color = scheme.onSurface,
|
color = scheme.onSurface,
|
||||||
style = MaterialTheme.typography.bodyMedium
|
style = MaterialTheme.typography.bodyMedium
|
||||||
)
|
)
|
||||||
if (uiState.isLive) {
|
Text(
|
||||||
Row(
|
text = formatTime(uiState.durationMs),
|
||||||
horizontalArrangement = Arrangement.spacedBy(16.dp),
|
color = scheme.onSurface,
|
||||||
verticalAlignment = Alignment.CenterVertically
|
style = MaterialTheme.typography.bodyMedium
|
||||||
) {
|
)
|
||||||
Text(
|
|
||||||
text = "LIVE",
|
|
||||||
color = scheme.primary,
|
|
||||||
fontWeight = FontWeight.Bold
|
|
||||||
)
|
|
||||||
Text(
|
|
||||||
text = "Catch up",
|
|
||||||
color = scheme.onSurface,
|
|
||||||
modifier = Modifier.clickable { onSeekLiveEdge() }
|
|
||||||
)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Text(
|
|
||||||
text = formatTime(uiState.durationMs),
|
|
||||||
color = scheme.onSurface,
|
|
||||||
style = MaterialTheme.typography.bodyMedium
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
TvPlayerSeekBar(
|
TvPlayerSeekBar(
|
||||||
positionMs = uiState.positionMs,
|
positionMs = uiState.positionMs,
|
||||||
@@ -330,7 +293,7 @@ private fun TvPlayerBottomSection(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
Row(
|
Row(
|
||||||
modifier = Modifier.align(Alignment.CenterEnd),
|
modifier = Modifier.align(Alignment.CenterStart),
|
||||||
horizontalArrangement = Arrangement.spacedBy(8.dp),
|
horizontalArrangement = Arrangement.spacedBy(8.dp),
|
||||||
verticalAlignment = Alignment.CenterVertically
|
verticalAlignment = Alignment.CenterVertically
|
||||||
) {
|
) {
|
||||||
@@ -356,6 +319,22 @@ private fun TvPlayerBottomSection(
|
|||||||
.testTag(TvPlayerSubtitlesButtonTag)
|
.testTag(TvPlayerSubtitlesButtonTag)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
if (uiState.activeSkippableSegmentEndMs != null) {
|
||||||
|
Row(
|
||||||
|
modifier = Modifier.align(Alignment.CenterEnd),
|
||||||
|
horizontalArrangement = Arrangement.spacedBy(8.dp),
|
||||||
|
verticalAlignment = Alignment.CenterVertically
|
||||||
|
) {
|
||||||
|
TvIconButton(
|
||||||
|
icon = Icons.Outlined.SkipNext,
|
||||||
|
contentDescription = "Skip segment",
|
||||||
|
onClick = onSkipSegment,
|
||||||
|
size = 64,
|
||||||
|
label = "Skip",
|
||||||
|
modifier = expandPlaylistModifier
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
AnimatedVisibility(
|
AnimatedVisibility(
|
||||||
visible = isPlaylistExpanded,
|
visible = isPlaylistExpanded,
|
||||||
|
|||||||
Reference in New Issue
Block a user