Detail playback row: drop the redundant Pause/Resume pill and the duplicate Stop text button — one filled Stop button, always present while playing
This commit is contained in:
parent
5d1f615d4a
commit
bcb32e4f01
1 changed files with 8 additions and 12 deletions
|
|
@ -636,18 +636,15 @@ fun DetailScreen(state: DesktopState) {
|
||||||
Row(verticalAlignment = Alignment.CenterVertically,
|
Row(verticalAlignment = Alignment.CenterVertically,
|
||||||
horizontalArrangement = Arrangement.spacedBy(8.dp)) {
|
horizontalArrangement = Arrangement.spacedBy(8.dp)) {
|
||||||
if (isPlaying) {
|
if (isPlaying) {
|
||||||
if (transport) {
|
// One Stop control, always present (the pause/resume pill
|
||||||
OutlinedButton({ state.setPaused(!ps.paused) }) {
|
// was redundant: Stop already ends playback, and the
|
||||||
Text(if (ps.paused) "Resume" else "Pause")
|
// separate Stop text button duplicated it).
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Button({ state.stopPlayback() }) {
|
Button({ state.stopPlayback() }) {
|
||||||
Icon(Icons.Filled.Stop, contentDescription = null,
|
Icon(Icons.Filled.Stop, contentDescription = null,
|
||||||
modifier = Modifier.size(18.dp))
|
modifier = Modifier.size(18.dp))
|
||||||
Spacer(Modifier.width(6.dp))
|
Spacer(Modifier.width(6.dp))
|
||||||
Text("Stop")
|
Text("Stop")
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (transport && ps.durationSec > 0) {
|
if (transport && ps.durationSec > 0) {
|
||||||
val dur = ps.durationSec
|
val dur = ps.durationSec
|
||||||
Slider(
|
Slider(
|
||||||
|
|
@ -663,7 +660,6 @@ fun DetailScreen(state: DesktopState) {
|
||||||
color = MaterialTheme.colorScheme.primary)
|
color = MaterialTheme.colorScheme.primary)
|
||||||
Spacer(Modifier.weight(1f))
|
Spacer(Modifier.weight(1f))
|
||||||
}
|
}
|
||||||
TextButton({ state.stopPlayback() }) { Text("Stop") }
|
|
||||||
} else {
|
} else {
|
||||||
OutlinedButton({ state.playFrom(detail.file) }) {
|
OutlinedButton({ state.playFrom(detail.file) }) {
|
||||||
Icon(Icons.Filled.PlayArrow, contentDescription = null,
|
Icon(Icons.Filled.PlayArrow, contentDescription = null,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue