Specify contentType in LazyLists
This commit is contained in:
parent
bb4d43d8a1
commit
e1f39005b6
4 changed files with 19 additions and 6 deletions
|
@ -262,7 +262,10 @@ fun HomeScreen(
|
|||
}
|
||||
}
|
||||
|
||||
items(playlistPreviews) { playlistPreview ->
|
||||
items(
|
||||
items = playlistPreviews,
|
||||
contentType = { it }
|
||||
) { playlistPreview ->
|
||||
PlaylistPreviewItem(
|
||||
playlistPreview = playlistPreview,
|
||||
modifier = Modifier
|
||||
|
@ -391,7 +394,8 @@ fun HomeScreen(
|
|||
items = songCollection,
|
||||
key = { _, song ->
|
||||
song.song.id
|
||||
}
|
||||
},
|
||||
contentType = { _, song -> song }
|
||||
) { index, song ->
|
||||
SongItem(
|
||||
song = song,
|
||||
|
|
|
@ -231,7 +231,10 @@ fun IntentUriScreen(uri: Uri) {
|
|||
)
|
||||
}
|
||||
} else {
|
||||
itemsIndexed(currentItems.value) { index, item ->
|
||||
itemsIndexed(
|
||||
items = currentItems.value,
|
||||
contentType = { _, item -> item }
|
||||
) { index, item ->
|
||||
SmallSongItem(
|
||||
song = item,
|
||||
thumbnailSizePx = density.run { 54.dp.roundToPx() },
|
||||
|
|
|
@ -273,8 +273,11 @@ fun LocalPlaylistScreen(
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
itemsIndexed(items = playlistWithSongs.songs, key = { _, song -> song.song.id }) { index, song ->
|
||||
itemsIndexed(
|
||||
items = playlistWithSongs.songs,
|
||||
key = { _, song -> song.song.id },
|
||||
contentType = { _, song -> song },
|
||||
) { index, song ->
|
||||
SongItem(
|
||||
song = song,
|
||||
thumbnailSize = thumbnailSize,
|
||||
|
|
|
@ -199,7 +199,10 @@ fun SearchResultScreen(
|
|||
)
|
||||
}
|
||||
|
||||
items(items) { item ->
|
||||
items(
|
||||
items = items,
|
||||
contentType = { it }
|
||||
) { item ->
|
||||
SmallItem(
|
||||
item = item,
|
||||
thumbnailSizeDp = 54.dp,
|
||||
|
|
Loading…
Reference in a new issue