Browse Source

ImageViewer fix delete picture crash (#3039)

pull/2920/merge
dima.avdeev 2 years ago committed by GitHub
parent
commit
73171a0f9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 15
      examples/imageviewer/shared/src/commonMain/kotlin/example/imageviewer/view/MemoryScreen.kt

15
examples/imageviewer/shared/src/commonMain/kotlin/example/imageviewer/view/MemoryScreen.kt

@ -97,12 +97,15 @@ fun MemoryScreen(
horizontalArrangement = Arrangement.spacedBy(8.dp)
) {
items(items = shuffledIndices) { index ->
Box(Modifier.size(130.dp).clip(RoundedCornerShape(8.dp))) {
SquareThumbnail(
picture = pictures[index],
isHighlighted = false,
onClick = { onSelectRelatedMemory(index) }
)
val relatedPicture = pictures.getOrNull(index)
if (relatedPicture != null) {
Box(Modifier.size(130.dp).clip(RoundedCornerShape(8.dp))) {
SquareThumbnail(
picture = relatedPicture,
isHighlighted = false,
onClick = { onSelectRelatedMemory(index) }
)
}
}
}
}

Loading…
Cancel
Save