refactor: Throw out overcomplicated shit code for Playback

This commit is contained in:
2026-04-08 18:03:23 +02:00
parent 674e0881d7
commit 1a17c52326
22 changed files with 162 additions and 1632 deletions

View File

@@ -77,12 +77,12 @@ fun TvPlayerScreen(
}
BackHandler(enabled = controlsVisible) {
viewModel.hideControls()
viewModel.toggleControlsVisibility()
}
LaunchedEffect(uiState.isPlaying) {
if (uiState.isPlaying) {
viewModel.hideControls()
if (uiState.isPlaying && controlsVisible) {
viewModel.toggleControlsVisibility()
}
}

View File

@@ -18,7 +18,6 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import hu.bbara.purefin.core.player.model.PlayerUiState
@@ -48,20 +47,11 @@ internal fun TvPlayerLoadingErrorEndCard(
verticalArrangement = Arrangement.spacedBy(16.dp)
) {
Text(
text = uiState.error?.summary ?: "Playback error",
text = uiState.error ?: "Playback error",
color = scheme.onBackground,
fontWeight = FontWeight.Bold,
style = MaterialTheme.typography.titleMedium
)
uiState.error?.detailText?.let { detail ->
Text(
text = detail,
color = scheme.onBackground.copy(alpha = 0.82f),
style = MaterialTheme.typography.bodySmall,
maxLines = 4,
overflow = TextOverflow.Ellipsis
)
}
Row(horizontalArrangement = Arrangement.spacedBy(12.dp)) {
Button(onClick = onRetry) {
Text("Retry")