Comments (5)
@David8aO I understand your situation. Zoomable is intended to be applied to AsyncImage as in your former example code. But as @IacobIonut01 said, current version of Zoomable does not work with compose v1.5.0-beta. Could you use compose v1.4.3 for now. I will close this issue, but I will continue to investigate it in #74 Thanks for your report.
@IacobIonut01 Thank you for your comment. I opened another issue about compose v1.5. If you have further information, I would be grateful if you could tell me.
No problem, as I've stated in my opened issue, it's clearly an internal problem inside the compose 1.5.0 beta, as the gestures suddenly stop working - the pager is consuming all of them, after 2 or 3 swipes, but it starts working again after Configuration changes (orientation, fold state etc)
from zoomable.
@David8aO
I understand your situation.
Zoomable is intended to be applied to AsyncImage as in your former example code. But as @IacobIonut01 said, current version of Zoomable does not work with compose v1.5.0-beta. Could you use compose v1.4.3 for now.
I will close this issue, but I will continue to investigate it in #74
Thanks for your report.
@IacobIonut01
Thank you for your comment.
I opened another issue about compose v1.5. If you have further information, I would be grateful if you could tell me.
from zoomable.
@David8aO
Thank you for your inquiry.
I also tried the combination of Coil and HorizontalPager but could not get the symptoms you mentioned.
The gesture detection algorithm does not recognize the swipe as a double tap no matter how fast you swipe.
This is because if your finger moves on the screen, it is determined to be a swipe, not a tap or double tap.
Therefore, I think something else is going on.
from zoomable.
Oh yhea, i forgot to mention i'm applying the zoomable modifier to the whole pager, instead of to each AsyncImage, because that way the zoom stops working randomly after a few swipes, please try this code out yourself.
val linkList = listOf(
"https://images2.imgbox.com/0d/f8/0ITo0HPx_o.jpg",
"https://images2.imgbox.com/02/03/jMPfhWE0_o.jpg",
"https://images2.imgbox.com/18/fc/9CIXu8kk_o.jpg",
"https://images2.imgbox.com/78/de/3tXEFY1N_o.jpg"
)
val pagerState = rememberPagerState {
linkList.size
}
HorizontalPager(
state = pagerState,
) { pageNumber ->
val zoomState = rememberZoomState()
AsyncImage(
modifier = Modifier
.fillMaxSize()
.zoomable(zoomState),
model = linkList[pageNumber],
contentDescription = "",
onSuccess = { state ->
zoomState.setContentSize(state.painter.intrinsicSize)
}
)
}
in the previous code, Zoom glitches and stops working at the 4th pic, but applying the modifier to the whole pager fixes it (code below).
I'm using compose foundation 1.5.0 horizontal pager by the way.
val linkList = listOf(
"https://images2.imgbox.com/0d/f8/0ITo0HPx_o.jpg",
"https://images2.imgbox.com/02/03/jMPfhWE0_o.jpg",
"https://images2.imgbox.com/18/fc/9CIXu8kk_o.jpg",
"https://images2.imgbox.com/78/de/3tXEFY1N_o.jpg"
)
val pagerState = rememberPagerState {
linkList.size
}
val zoomState = rememberZoomState()
HorizontalPager(
state = pagerState,
modifier = Modifier.zoomable(zoomState),
) { pageNumber ->
AsyncImage(
modifier = Modifier
.fillMaxSize(),
model = linkList[pageNumber],
contentDescription = "",
onSuccess = { state ->
zoomState.setContentSize(state.painter.intrinsicSize)
}
)
}
Applying the zoomable modifier to the entire pager (previous code) will fix the zooming behaviour glitching, but instead will trigger unwanted zooms using the double tap feature (what i originally opened the issue for)
I hope you could help me out with this. thanks in advance
from zoomable.
I've had this issue earlier with the beta version of compose (foundation). It's actually a bug in the library itself, I recommend reverting back to 1.4.3 (stable)
from zoomable.
Related Issues (20)
- Zoom on double tap HOT 5
- Rotation HOT 5
- Support for zooming only when pinching HOT 3
- Support for boundary clip HOT 1
- How to prevent over-panning? HOT 2
- State Restoration HOT 1
- make zoomable image like instagram posts HOT 5
- onTouchEvent is not broadcasted to the view when the view is zoomed HOT 2
- Support for KMP HOT 6
- Single Tap isn't strict HOT 3
- Support Swipe-to-Dismiss behavior HOT 1
- How ZoomState exposes offsetX, offsetY and scale so i can find what part of the image is being displayed. HOT 5
- Key param HOT 7
- Min/Max scale HOT 4
- Crash with large images HOT 4
- Zoom is spreading over other composables HOT 5
- Paparazzi screenshot test failing HOT 1
- How to zoom at the center of the image programmatically HOT 3
- detects wrong taps on zoomable LazyList when scrolling
- Individual Zoom for Canvas Rectangles using rememberZoomState. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zoomable.