show the disc icon on every disc header

DiscFull reads as an error icon, so use FiberSmartRecord, render it on
the "Disc N" fallback too, sit it 8dp from the edge with 8dp before the
text, and size it 20dp.
This commit is contained in:
austinried
2026-10-04 00:29:58 +00:00
parent 68a5787d9f
commit 5fe32c8766
@@ -7,7 +7,7 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width import androidx.compose.foundation.layout.width
import androidx.compose.material.icons.Icons import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.DiscFull import androidx.compose.material.icons.rounded.FiberSmartRecord
import androidx.compose.material3.Icon import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text import androidx.compose.material3.Text
@@ -127,7 +127,7 @@ fun AlbumDetailScreen(
val disc = song.disc ?: 1L val disc = song.disc ?: 1L
val discLabel = discLabels[disc] val discLabel = discLabels[disc]
if (disc != lastDisc && (multiDisc || discLabel != null)) { if (disc != lastDisc && (multiDisc || discLabel != null)) {
item(key = "disc:$disc") { DiscHeader(discLabel ?: "Disc $disc", showIcon = discLabel != null) } item(key = "disc:$disc") { DiscHeader(discLabel ?: "Disc $disc") }
} }
lastDisc = disc lastDisc = disc
item(key = song.id) { item(key = song.id) {
@@ -145,23 +145,18 @@ fun AlbumDetailScreen(
} }
@Composable @Composable
private fun DiscHeader( private fun DiscHeader(text: String) {
text: String,
showIcon: Boolean,
) {
Row( Row(
verticalAlignment = Alignment.CenterVertically, verticalAlignment = Alignment.CenterVertically,
modifier = Modifier.padding(start = 16.dp, end = 16.dp, top = 20.dp, bottom = 4.dp), modifier = Modifier.padding(start = 8.dp, end = 16.dp, top = 20.dp, bottom = 4.dp),
) { ) {
if (showIcon) { Icon(
Icon( imageVector = Icons.Rounded.FiberSmartRecord,
imageVector = Icons.Rounded.DiscFull, contentDescription = null,
contentDescription = null, tint = MaterialTheme.colorScheme.onSurfaceVariant,
tint = MaterialTheme.colorScheme.onSurfaceVariant, modifier = Modifier.size(20.dp),
modifier = Modifier.size(16.dp), )
) Spacer(Modifier.width(8.dp))
Spacer(Modifier.width(8.dp))
}
Text( Text(
text = text, text = text,
style = MaterialTheme.typography.titleMedium, style = MaterialTheme.typography.titleMedium,