Skip to content
This repository has been archived by the owner on Aug 2, 2024. It is now read-only.

Commit

Permalink
Update pagingCompose dependencyversion, Update LazyGridScope Implemen…
Browse files Browse the repository at this point in the history
…tation (#935)

Co-authored-by: Chris Arriola <[email protected]>
  • Loading branch information
tjmtic and arriolac authored Dec 15, 2023
1 parent 0a07de2 commit cdccad4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import androidx.hilt.navigation.compose.hiltViewModel
import androidx.paging.PagingData
import androidx.paging.compose.LazyPagingItems
import androidx.paging.compose.collectAsLazyPagingItems
import androidx.paging.compose.itemKey
import com.google.samples.apps.sunflower.R
import com.google.samples.apps.sunflower.compose.plantlist.PhotoListItem
import com.google.samples.apps.sunflower.data.UnsplashPhoto
Expand Down Expand Up @@ -79,14 +80,9 @@ private fun GalleryScreen(
modifier = Modifier.padding(padding),
contentPadding = PaddingValues(all = dimensionResource(id = R.dimen.card_side_margin))
) {
// TODO update this implementation once paging Compose supports LazyGridScope
// See: https://issuetracker.google.com/issues/178087310
items(
count = pagingItems.itemCount,
key = { index ->
val photo = pagingItems[index]
"${ photo?.id ?: ""}${index}"
}
key = pagingItems.itemKey { it }
) { index ->
val photo = pagingItems[index] ?: return@items
PhotoListItem(photo = photo) {
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ minSdk = "23"
monitor = "1.6.0"
navigation = "2.5.3"
okhttpLogging = "4.10.0"
pagingCompose = "1.0.0-alpha18"
pagingCompose = "1.0.0-alpha19"
profileInstaller = "1.2.0"
recyclerView = "1.3.0-alpha02"
retrofit = "2.9.0"
Expand Down

0 comments on commit cdccad4

Please sign in to comment.