mirror of
https://github.com/bbara04/Purefin.git
synced 2026-07-23 19:26:50 +00:00
refactor: Throw out overcomplicated shit code for Playback
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user