Browse Source

hotifx bug with related pictures (#3017)

pull/3019/head
dima.avdeev 1 year ago committed by GitHub
parent
commit
cc1ad2fe41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      examples/imageviewer/shared/src/commonMain/kotlin/example/imageviewer/ImageViewer.common.kt
  2. 6
      examples/imageviewer/shared/src/commonMain/kotlin/example/imageviewer/view/MemoryScreen.kt

4
examples/imageviewer/shared/src/commonMain/kotlin/example/imageviewer/ImageViewer.common.kt

@ -94,8 +94,8 @@ fun ImageViewerWithProvidedDependencies(
MemoryScreen(
pictures = pictures,
memoryPage = page,
onSelectRelatedMemory = { pictureIndex ->
navigationStack.push(MemoryPage(pictureIndex))
onSelectRelatedMemory = { picture: PictureData ->
navigationStack.push(MemoryPage(pictures.indexOf(picture)))
},
onBack = { resetNavigation ->
if (resetNavigation) {

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

@ -43,7 +43,7 @@ import org.jetbrains.compose.resources.ExperimentalResourceApi
fun MemoryScreen(
pictures: SnapshotStateList<PictureData>,
memoryPage: MemoryPage,
onSelectRelatedMemory: (index: Int) -> Unit,
onSelectRelatedMemory: (picture: PictureData) -> Unit,
onBack: (resetNavigation: Boolean) -> Unit,
onHeaderClick: (index: Int) -> Unit,
) {
@ -273,7 +273,7 @@ fun Headliner(s: String) {
@Composable
fun RelatedMemoriesVisualizer(
pictures: List<PictureData>,
onSelectRelatedMemory: (index: Int) -> Unit
onSelectRelatedMemory: (picture: PictureData) -> Unit
) {
Box(
modifier = Modifier.padding(10.dp, 0.dp).clip(RoundedCornerShape(10.dp)).fillMaxWidth()
@ -287,7 +287,7 @@ fun RelatedMemoriesVisualizer(
SquareThumbnail(
picture = item,
isHighlighted = false,
onClick = { onSelectRelatedMemory(index) })
onClick = { onSelectRelatedMemory(item) })
}
}
}

Loading…
Cancel
Save