feat: M3 weighted shuffle v1 — real /api/radio with scoring #21
@@ -64,7 +64,6 @@ fun NowPlayingScreen(
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxSize()
|
.fillMaxSize()
|
||||||
@@ -72,6 +71,31 @@ fun NowPlayingScreen(
|
|||||||
verticalArrangement = Arrangement.Center,
|
verticalArrangement = Arrangement.Center,
|
||||||
horizontalAlignment = Alignment.CenterHorizontally,
|
horizontalAlignment = Alignment.CenterHorizontally,
|
||||||
) {
|
) {
|
||||||
|
CoverPlaceholder()
|
||||||
|
Spacer(Modifier.height(24.dp))
|
||||||
|
TrackHeader(
|
||||||
|
title = track.title,
|
||||||
|
artist = track.artistName,
|
||||||
|
album = track.albumTitle,
|
||||||
|
)
|
||||||
|
Spacer(Modifier.height(24.dp))
|
||||||
|
ScrubberRow(
|
||||||
|
positionMs = state.positionMs,
|
||||||
|
durationMs = state.durationMs,
|
||||||
|
onSeek = viewModel::seekTo,
|
||||||
|
)
|
||||||
|
Spacer(Modifier.height(8.dp))
|
||||||
|
TransportRow(
|
||||||
|
isPlaying = state.isPlaying,
|
||||||
|
onPrev = viewModel::skipToPrevious,
|
||||||
|
onPlayPause = { if (state.isPlaying) viewModel.pause() else viewModel.play() },
|
||||||
|
onNext = viewModel::skipToNext,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
private fun CoverPlaceholder() {
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.widthIn(max = COVER_MAX_WIDTH_DP.dp)
|
.widthIn(max = COVER_MAX_WIDTH_DP.dp)
|
||||||
@@ -87,9 +111,12 @@ fun NowPlayingScreen(
|
|||||||
modifier = Modifier.size(96.dp),
|
modifier = Modifier.size(96.dp),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
Spacer(Modifier.height(24.dp))
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
private fun TrackHeader(title: String, artist: String, album: String) {
|
||||||
Text(
|
Text(
|
||||||
text = track.title,
|
text = title,
|
||||||
style = MaterialTheme.typography.headlineMedium,
|
style = MaterialTheme.typography.headlineMedium,
|
||||||
color = MaterialTheme.colorScheme.onBackground,
|
color = MaterialTheme.colorScheme.onBackground,
|
||||||
textAlign = TextAlign.Center,
|
textAlign = TextAlign.Center,
|
||||||
@@ -97,16 +124,16 @@ fun NowPlayingScreen(
|
|||||||
overflow = TextOverflow.Ellipsis,
|
overflow = TextOverflow.Ellipsis,
|
||||||
)
|
)
|
||||||
Text(
|
Text(
|
||||||
text = track.artistName,
|
text = artist,
|
||||||
style = MaterialTheme.typography.titleMedium,
|
style = MaterialTheme.typography.titleMedium,
|
||||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||||
textAlign = TextAlign.Center,
|
textAlign = TextAlign.Center,
|
||||||
maxLines = 1,
|
maxLines = 1,
|
||||||
overflow = TextOverflow.Ellipsis,
|
overflow = TextOverflow.Ellipsis,
|
||||||
)
|
)
|
||||||
if (track.albumTitle.isNotEmpty()) {
|
if (album.isNotEmpty()) {
|
||||||
Text(
|
Text(
|
||||||
text = track.albumTitle,
|
text = album,
|
||||||
style = MaterialTheme.typography.bodyMedium,
|
style = MaterialTheme.typography.bodyMedium,
|
||||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||||
textAlign = TextAlign.Center,
|
textAlign = TextAlign.Center,
|
||||||
@@ -114,20 +141,6 @@ fun NowPlayingScreen(
|
|||||||
overflow = TextOverflow.Ellipsis,
|
overflow = TextOverflow.Ellipsis,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
Spacer(Modifier.height(24.dp))
|
|
||||||
ScrubberRow(
|
|
||||||
positionMs = state.positionMs,
|
|
||||||
durationMs = state.durationMs,
|
|
||||||
onSeek = viewModel::seekTo,
|
|
||||||
)
|
|
||||||
Spacer(Modifier.height(8.dp))
|
|
||||||
TransportRow(
|
|
||||||
isPlaying = state.isPlaying,
|
|
||||||
onPrev = viewModel::skipToPrevious,
|
|
||||||
onPlayPause = { if (state.isPlaying) viewModel.pause() else viewModel.play() },
|
|
||||||
onNext = viewModel::skipToNext,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
|
|||||||
Reference in New Issue
Block a user