fix(tv-player): Only show paused feedback

This commit is contained in:
2026-06-20 21:11:23 +02:00
parent a5d04998ac
commit bd2c1777a5

View File

@@ -23,7 +23,6 @@ import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.Pause import androidx.compose.material.icons.outlined.Pause
import androidx.compose.material.icons.outlined.PlayArrow
import androidx.compose.material.icons.outlined.SkipNext import androidx.compose.material.icons.outlined.SkipNext
import androidx.compose.material3.Icon import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MaterialTheme
@@ -400,7 +399,7 @@ fun TvPlayerScreen(
hideAfterMillis = TV_HIDDEN_STOP_FEEDBACK_MS, hideAfterMillis = TV_HIDDEN_STOP_FEEDBACK_MS,
modifier = Modifier.align(Alignment.Center) modifier = Modifier.align(Alignment.Center)
) { ) {
TvPlayerResumeStopFeedback(resume = uiState.isPlaying) TvPlayerStopFeedback(stopped = !uiState.isPlaying)
} }
AnimatedVisibility( AnimatedVisibility(
@@ -535,10 +534,13 @@ internal fun handleTvPlayerRootKeyEvent(
} }
@Composable @Composable
internal fun TvPlayerResumeStopFeedback( internal fun TvPlayerStopFeedback(
resume: Boolean, stopped: Boolean,
modifier: Modifier = Modifier modifier: Modifier = Modifier
) { ) {
if (!stopped) {
return
}
Box( Box(
modifier = modifier modifier = modifier
.testTag(TvPlayerHiddenStopFeedbackTag) .testTag(TvPlayerHiddenStopFeedbackTag)
@@ -548,7 +550,7 @@ internal fun TvPlayerResumeStopFeedback(
contentAlignment = Alignment.Center contentAlignment = Alignment.Center
) { ) {
Icon( Icon(
imageVector = if (resume) Icons.Outlined.PlayArrow else Icons.Outlined.Pause, imageVector = Icons.Outlined.Pause,
contentDescription = "Play/Pause playback", contentDescription = "Play/Pause playback",
tint = MaterialTheme.colorScheme.onSurface, tint = MaterialTheme.colorScheme.onSurface,
modifier = Modifier.size(72.dp) modifier = Modifier.size(72.dp)