Individual zoomableState per pager item
This commit is contained in:
1 parent
6f9fceaef8
commit
f7259c5b40
3 files changed
+4
-3
No files matched your search
@@ -43,7 +43,6 @@ fun GalleryPager(
|
||||
val items = pageLoader.pages
|
||||
when (type) {
|
||||
DEFAULT, LEFT_TO_RIGHT, RIGHT_TO_LEFT -> {
|
||||
val zoomableState = rememberZoomableState(zoomSpec = zoomSpec)
|
||||
HorizontalPager(
|
||||
state = pagerState,
|
||||
modifier = modifier,
|
||||
@@ -51,6 +50,7 @@ fun GalleryPager(
|
||||
key = { it },
|
||||
) { index ->
|
||||
val page = items[index]
|
||||
val zoomableState = rememberZoomableState(zoomSpec = zoomSpec)
|
||||
val status by page.status.collectAsState()
|
||||
val boxModifier = if (status == Page.State.READY) {
|
||||
Modifier.zoomable(
|
||||
@@ -79,13 +79,13 @@ fun GalleryPager(
|
||||
}
|
||||
}
|
||||
VERTICAL -> {
|
||||
val zoomableState = rememberZoomableState(zoomSpec = zoomSpec)
|
||||
VerticalPager(
|
||||
state = pagerState,
|
||||
modifier = modifier,
|
||||
key = { it },
|
||||
) { index ->
|
||||
val page = items[index]
|
||||
val zoomableState = rememberZoomableState(zoomSpec = zoomSpec)
|
||||
val status by page.status.collectAsState()
|
||||
val boxModifier = if (status == Page.State.READY) {
|
||||
Modifier.zoomable(
|
||||
|
||||
@@ -28,7 +28,7 @@ ksp = "2.0.0-Beta4-1.0.19"
|
||||
ktor = "3.0.0-beta-1"
|
||||
okio = "3.9.0"
|
||||
splitties = "3.0.0"
|
||||
telephoto = "0.8.0"
|
||||
telephoto = "0.9.0-SNAPSHOT"
|
||||
xmlutil = "0.86.3"
|
||||
|
||||
[libraries]
|
||||
|
||||
@@ -11,6 +11,7 @@ dependencyResolutionManagement {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
maven("https://oss.sonatype.org/content/repositories/snapshots")
|
||||
maven("https://jitpack.io")
|
||||
maven("https://androidx.dev/storage/compose-compiler/repository/")
|
||||
maven("https://androidx.dev/snapshots/builds/11527796/artifacts/repository")
|
||||
|
||||
Reference in new issue
Block a user