mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-11 15:29:15 +01:00
key the queue now-playing highlight by song id
This commit is contained in:
@@ -254,7 +254,7 @@ fun QueueRoute(
|
|||||||
QueueScreen(
|
QueueScreen(
|
||||||
rows = viewModel.rows,
|
rows = viewModel.rows,
|
||||||
ready = viewModel.ready,
|
ready = viewModel.ready,
|
||||||
currentPosition = playback.position,
|
currentSongId = playback.item?.id,
|
||||||
coverArt = sourceRepository::coverArt,
|
coverArt = sourceRepository::coverArt,
|
||||||
onBack = onBack,
|
onBack = onBack,
|
||||||
onPlay = viewModel::play,
|
onPlay = viewModel::play,
|
||||||
@@ -273,7 +273,7 @@ fun QueueRoute(
|
|||||||
fun QueueScreen(
|
fun QueueScreen(
|
||||||
rows: List<QueueRow>,
|
rows: List<QueueRow>,
|
||||||
ready: Boolean,
|
ready: Boolean,
|
||||||
currentPosition: Long?,
|
currentSongId: String?,
|
||||||
coverArt: (String?, Boolean) -> CoverArtRef?,
|
coverArt: (String?, Boolean) -> CoverArtRef?,
|
||||||
onBack: () -> Unit,
|
onBack: () -> Unit,
|
||||||
onPlay: (Long) -> Unit,
|
onPlay: (Long) -> Unit,
|
||||||
@@ -361,7 +361,7 @@ fun QueueScreen(
|
|||||||
) { isDragging ->
|
) { isDragging ->
|
||||||
QueueRowItem(
|
QueueRowItem(
|
||||||
row = row,
|
row = row,
|
||||||
isPlaying = row.position == currentPosition,
|
isPlaying = row.song.song.id == currentSongId,
|
||||||
floating = isDragging,
|
floating = isDragging,
|
||||||
coverArt = coverArt,
|
coverArt = coverArt,
|
||||||
dragHandle =
|
dragHandle =
|
||||||
|
|||||||
@@ -308,7 +308,7 @@ class AppScreenshotTest {
|
|||||||
rows =
|
rows =
|
||||||
Fixtures.songItems.mapIndexed { index, item -> QueueRow(index.toLong(), index.toLong(), item) },
|
Fixtures.songItems.mapIndexed { index, item -> QueueRow(index.toLong(), index.toLong(), item) },
|
||||||
ready = true,
|
ready = true,
|
||||||
currentPosition = 1,
|
currentSongId = Fixtures.songItems[1].song.id,
|
||||||
coverArt = { id, _ -> id?.let { CoverArtRef(it, "test:$it") } },
|
coverArt = { id, _ -> id?.let { CoverArtRef(it, "test:$it") } },
|
||||||
onBack = {},
|
onBack = {},
|
||||||
onPlay = {},
|
onPlay = {},
|
||||||
|
|||||||
Reference in New Issue
Block a user