diff --git a/app/src/main/java/eu/kanade/presentation/browse/components/BrowseSourceComfortableGrid.kt b/app/src/main/java/eu/kanade/presentation/browse/components/BrowseSourceComfortableGrid.kt index 77cec7c6c..bbbb543ab 100644 --- a/app/src/main/java/eu/kanade/presentation/browse/components/BrowseSourceComfortableGrid.kt +++ b/app/src/main/java/eu/kanade/presentation/browse/components/BrowseSourceComfortableGrid.kt @@ -11,6 +11,7 @@ import androidx.compose.runtime.getValue import androidx.compose.ui.unit.dp import androidx.paging.LoadState import androidx.paging.compose.LazyPagingItems +import androidx.paging.compose.itemKey import eu.kanade.presentation.library.components.CommonMangaItemDefaults import eu.kanade.presentation.library.components.MangaComfortableGridItem import kotlinx.coroutines.flow.StateFlow @@ -38,7 +39,10 @@ fun BrowseSourceComfortableGrid( } } - items(mangaList.itemCount) { index -> + items( + count = mangaList.itemCount, + key = mangaList.itemKey { it.value.id }, + ) { index -> val manga by mangaList[index]?.collectAsState() ?: return@items BrowseSourceComfortableGridItem( manga = manga, diff --git a/app/src/main/java/eu/kanade/presentation/browse/components/BrowseSourceCompactGrid.kt b/app/src/main/java/eu/kanade/presentation/browse/components/BrowseSourceCompactGrid.kt index d5ce6fc4c..a6b5027c4 100644 --- a/app/src/main/java/eu/kanade/presentation/browse/components/BrowseSourceCompactGrid.kt +++ b/app/src/main/java/eu/kanade/presentation/browse/components/BrowseSourceCompactGrid.kt @@ -11,6 +11,7 @@ import androidx.compose.runtime.getValue import androidx.compose.ui.unit.dp import androidx.paging.LoadState import androidx.paging.compose.LazyPagingItems +import androidx.paging.compose.itemKey import eu.kanade.presentation.library.components.CommonMangaItemDefaults import eu.kanade.presentation.library.components.MangaCompactGridItem import kotlinx.coroutines.flow.StateFlow @@ -38,7 +39,10 @@ fun BrowseSourceCompactGrid( } } - items(mangaList.itemCount) { index -> + items( + count = mangaList.itemCount, + key = mangaList.itemKey { it.value.id }, + ) { index -> val manga by mangaList[index]?.collectAsState() ?: return@items BrowseSourceCompactGridItem( manga = manga, diff --git a/app/src/main/java/eu/kanade/presentation/browse/components/BrowseSourceList.kt b/app/src/main/java/eu/kanade/presentation/browse/components/BrowseSourceList.kt index 5703386ce..f5f3ae701 100644 --- a/app/src/main/java/eu/kanade/presentation/browse/components/BrowseSourceList.kt +++ b/app/src/main/java/eu/kanade/presentation/browse/components/BrowseSourceList.kt @@ -7,7 +7,7 @@ import androidx.compose.runtime.getValue import androidx.compose.ui.unit.dp import androidx.paging.LoadState import androidx.paging.compose.LazyPagingItems -import androidx.paging.compose.items +import androidx.paging.compose.itemKey import eu.kanade.presentation.library.components.CommonMangaItemDefaults import eu.kanade.presentation.library.components.MangaListItem import kotlinx.coroutines.flow.StateFlow @@ -32,9 +32,11 @@ fun BrowseSourceList( } } - items(mangaList) { mangaflow -> - mangaflow ?: return@items - val manga by mangaflow.collectAsState() + items( + count = mangaList.itemCount, + key = mangaList.itemKey { it.value.id }, + ) { index -> + val manga by mangaList[index]?.collectAsState() ?: return@items BrowseSourceListItem( manga = manga, onClick = { onMangaClick(manga) }, diff --git a/gradle/androidx.versions.toml b/gradle/androidx.versions.toml index 11b36a76a..803567143 100644 --- a/gradle/androidx.versions.toml +++ b/gradle/androidx.versions.toml @@ -15,7 +15,7 @@ splashscreen = "androidx.core:core-splashscreen:1.0.0-alpha02" recyclerview = "androidx.recyclerview:recyclerview:1.3.0" viewpager = "androidx.viewpager:viewpager:1.1.0-alpha01" glance = "androidx.glance:glance-appwidget:1.0.0-alpha03" -profileinstaller = "androidx.profileinstaller:profileinstaller:1.3.0" +profileinstaller = "androidx.profileinstaller:profileinstaller:1.3.1" lifecycle-common = { module = "androidx.lifecycle:lifecycle-common", version.ref = "lifecycle_version" } lifecycle-process = { module = "androidx.lifecycle:lifecycle-process", version.ref = "lifecycle_version" } @@ -25,7 +25,7 @@ work-runtime = "androidx.work:work-runtime-ktx:2.8.1" guava = "com.google.guava:guava:31.1-android" paging-runtime = "androidx.paging:paging-runtime:3.1.1" -paging-compose = "androidx.paging:paging-compose:1.0.0-alpha18" +paging-compose = "androidx.paging:paging-compose:1.0.0-alpha19" benchmark-macro = "androidx.benchmark:benchmark-macro-junit4:1.1.1" test-ext = "androidx.test.ext:junit-ktx:1.1.5"