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( PlaylistPreviewItem(
playlistPreview = playlistPreview, playlistPreview = playlistPreview,
modifier = Modifier modifier = Modifier
@ -391,7 +394,8 @@ fun HomeScreen(
items = songCollection, items = songCollection,
key = { _, song -> key = { _, song ->
song.song.id song.song.id
} },
contentType = { _, song -> song }
) { index, song -> ) { index, song ->
SongItem( SongItem(
song = song, song = song,

View file

@ -231,7 +231,10 @@ fun IntentUriScreen(uri: Uri) {
) )
} }
} else { } else {
itemsIndexed(currentItems.value) { index, item -> itemsIndexed(
items = currentItems.value,
contentType = { _, item -> item }
) { index, item ->
SmallSongItem( SmallSongItem(
song = item, song = item,
thumbnailSizePx = density.run { 54.dp.roundToPx() }, thumbnailSizePx = density.run { 54.dp.roundToPx() },

View file

@ -273,8 +273,11 @@ fun LocalPlaylistScreen(
} }
} }
itemsIndexed(
itemsIndexed(items = playlistWithSongs.songs, key = { _, song -> song.song.id }) { index, song -> items = playlistWithSongs.songs,
key = { _, song -> song.song.id },
contentType = { _, song -> song },
) { index, song ->
SongItem( SongItem(
song = song, song = song,
thumbnailSize = thumbnailSize, thumbnailSize = thumbnailSize,

View file

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