mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-15 00:37:03 +05:30
Revert "fix(android): remove explicit item keys"
This causes subtle UI artifacts that make me more annoyed than the occasional crash.
This reverts commit 2a97383e7d
.
This commit is contained in:
parent
fd8b65be72
commit
2a3514e3b5
2 changed files with 3 additions and 0 deletions
|
@ -56,6 +56,7 @@ fun DatabasePosts(
|
||||||
stickyHeader(contentType = "month-header") { MonthHeader(month = month) }
|
stickyHeader(contentType = "month-header") { MonthHeader(month = month) }
|
||||||
items(
|
items(
|
||||||
items = posts,
|
items = posts,
|
||||||
|
key = { it.shortId },
|
||||||
contentType = { "LobstersItem" },
|
contentType = { "LobstersItem" },
|
||||||
) { item ->
|
) { item ->
|
||||||
ListItem(
|
ListItem(
|
||||||
|
|
|
@ -28,6 +28,7 @@ import androidx.compose.ui.unit.dp
|
||||||
import androidx.paging.LoadState
|
import androidx.paging.LoadState
|
||||||
import androidx.paging.compose.LazyPagingItems
|
import androidx.paging.compose.LazyPagingItems
|
||||||
import androidx.paging.compose.itemContentType
|
import androidx.paging.compose.itemContentType
|
||||||
|
import androidx.paging.compose.itemKey
|
||||||
import dev.msfjarvis.claw.common.posts.PostActions
|
import dev.msfjarvis.claw.common.posts.PostActions
|
||||||
import dev.msfjarvis.claw.common.posts.toDbModel
|
import dev.msfjarvis.claw.common.posts.toDbModel
|
||||||
import dev.msfjarvis.claw.common.ui.NetworkError
|
import dev.msfjarvis.claw.common.ui.NetworkError
|
||||||
|
@ -61,6 +62,7 @@ fun NetworkPosts(
|
||||||
) {
|
) {
|
||||||
items(
|
items(
|
||||||
count = lazyPagingItems.itemCount,
|
count = lazyPagingItems.itemCount,
|
||||||
|
key = lazyPagingItems.itemKey { it.shortId },
|
||||||
contentType = lazyPagingItems.itemContentType { "LobstersItem" },
|
contentType = lazyPagingItems.itemContentType { "LobstersItem" },
|
||||||
) { index ->
|
) { index ->
|
||||||
val item = lazyPagingItems[index]
|
val item = lazyPagingItems[index]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue