This commit is contained in:
2024-08-17 17:40:21 +08:00
parent e8140579e0
commit 6137e1c3b5
18 changed files with 494 additions and 63 deletions

View File

@@ -1,9 +1,11 @@
package com.aiosman.riderpro.ui.imageviewer
import com.aiosman.riderpro.model.MomentImageEntity
object ImageViewerViewModel {
var imageList = mutableListOf<String>()
var imageList = mutableListOf<MomentImageEntity>()
var initialIndex = 0
fun asNew(images: List<String>, index: Int = 0) {
fun asNew(images: List<MomentImageEntity>, index: Int = 0) {
imageList.clear()
imageList.addAll(images)
initialIndex = index

View File

@@ -54,7 +54,7 @@ fun ImageViewer() {
with(sharedTransitionScope) {
CustomAsyncImage(
context,
images[page],
images[page].url,
contentDescription = null,
modifier = Modifier.sharedElement(
rememberSharedContentState(key = images[page]),