join play and shuffle into one split pill

This commit is contained in:
austinried
2026-10-04 00:29:56 +00:00
parent a3de58b7b8
commit ebf0653ec4
@@ -22,6 +22,7 @@ import androidx.compose.foundation.layout.width
import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.LazyListScope import androidx.compose.foundation.lazy.LazyListScope
import androidx.compose.foundation.lazy.rememberLazyListState import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.rounded.ArrowBack import androidx.compose.material.icons.automirrored.rounded.ArrowBack
import androidx.compose.material.icons.rounded.Download import androidx.compose.material.icons.rounded.Download
@@ -261,24 +262,36 @@ fun HeroHeader(
} }
Row( Row(
modifier = Modifier.weight(1f), modifier = Modifier.weight(1f),
horizontalArrangement = Arrangement.spacedBy(16.dp, Alignment.CenterHorizontally), horizontalArrangement = Arrangement.Center,
verticalAlignment = Alignment.CenterVertically, verticalAlignment = Alignment.CenterVertically,
) { ) {
Box(contentAlignment = Alignment.Center) {
Row {
FilledIconButton( FilledIconButton(
onClick = onPlay, onClick = onPlay,
enabled = hasSongs, enabled = hasSongs,
modifier = Modifier.width(76.dp).height(48.dp), shape = RoundedCornerShape(topStart = 24.dp, bottomStart = 24.dp),
modifier = Modifier.width(56.dp).height(48.dp),
) { ) {
Icon(Icons.Rounded.PlayArrow, contentDescription = "Play", modifier = Modifier.size(30.dp)) Icon(Icons.Rounded.PlayArrow, contentDescription = "Play", modifier = Modifier.size(30.dp))
} }
FilledIconButton( FilledIconButton(
onClick = onShuffle, onClick = onShuffle,
enabled = hasSongs, enabled = hasSongs,
modifier = Modifier.width(76.dp).height(48.dp), shape = RoundedCornerShape(topEnd = 24.dp, bottomEnd = 24.dp),
modifier = Modifier.width(56.dp).height(48.dp),
) { ) {
Icon(Icons.Rounded.Shuffle, contentDescription = "Shuffle play", modifier = Modifier.size(30.dp)) Icon(Icons.Rounded.Shuffle, contentDescription = "Shuffle play", modifier = Modifier.size(30.dp))
} }
} }
Box(
Modifier
.width(1.dp)
.height(20.dp)
.background(MaterialTheme.colorScheme.onPrimary.copy(alpha = 0.35f)),
)
}
}
IconButton(onClick = onMore, modifier = Modifier.padding(horizontal = 8.dp)) { IconButton(onClick = onMore, modifier = Modifier.padding(horizontal = 8.dp)) {
Icon(Icons.Rounded.MoreHoriz, contentDescription = "More options") Icon(Icons.Rounded.MoreHoriz, contentDescription = "More options")
} }