feat(android): QueueScreen rows show artist · album + duration (audit v3 §4.17)
Queue rows only showed title + artist. Now the subtitle reads "Artist · Album" (collapsing gracefully when either is empty) and a trailing m:ss duration appears when known — matches Flutter's queue row density so users can tell tracks apart by album + length. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -123,9 +123,10 @@ private fun QueueRow(track: TrackRef, isCurrent: Boolean, onClick: () -> Unit) {
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
)
|
||||
if (track.artistName.isNotEmpty()) {
|
||||
val subtitle = queueSubtitle(track)
|
||||
if (subtitle.isNotEmpty()) {
|
||||
Text(
|
||||
text = track.artistName,
|
||||
text = subtitle,
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
maxLines = 1,
|
||||
@@ -133,7 +134,27 @@ private fun QueueRow(track: TrackRef, isCurrent: Boolean, onClick: () -> Unit) {
|
||||
)
|
||||
}
|
||||
}
|
||||
if (track.durationSec > 0) {
|
||||
Text(
|
||||
text = formatDuration(track.durationSec),
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** "Artist · Album" — collapses gracefully when either is missing. */
|
||||
private fun queueSubtitle(track: TrackRef): String = listOf(track.artistName, track.albumTitle)
|
||||
.filter { it.isNotEmpty() }
|
||||
.joinToString(" · ")
|
||||
|
||||
private const val SECONDS_PER_MINUTE = 60
|
||||
|
||||
private fun formatDuration(seconds: Int): String {
|
||||
val mins = seconds / SECONDS_PER_MINUTE
|
||||
val secs = seconds % SECONDS_PER_MINUTE
|
||||
return "%d:%02d".format(mins, secs)
|
||||
}
|
||||
|
||||
private const val HIGHLIGHT_ALPHA = 0.12f
|
||||
|
||||
Reference in New Issue
Block a user