Specify contentType in LazyLists

This commit is contained in:
vfsfitvnm 2022-06-09 15:40:36 +02:00
parent bb4d43d8a1
commit e1f39005b6
4 changed files with 19 additions and 6 deletions

View file

@ -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,

View file

@ -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() },

View file

@ -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,

View file

@ -199,7 +199,10 @@ fun SearchResultScreen(
)
}
items(items) { item ->
items(
items = items,
contentType = { it }
) { item ->
SmallItem(
item = item,
thumbnailSizeDp = 54.dp,