-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SSIV in Jetpack Compose (AndroidView) #548
Comments
I'm not familiar with Jetpack Compose, and as I'm not an active Android developer any more I'm not going to be able to learn enough about it to resolve this one. Another new way of building Android apps will be along in a few months :-) It appears that the behaviour of Are you able to try copying the SubsamplingScaleImageView class into your project, and modifying it? If so you could try changing line 1027 to |
If people are still looking for an alternative, I just released telephoto for displaying zoomable images in compose with automatic sub-sampling: https://saket.github.io/telephoto/zoomableimage/ |
Actually I'm still using SSIV with AndroidView, the freezing is gone for me, not sure if it was an update of compose or something else. It has been some time since then and btw sorry for not coming back to this issue earlier. Only issue that remains with SSIV and compose are some gestures that are not working. @saket Looks very promising, will give it a try in near future. Thanks for sharing. |
If you are looking for a zoom image component on compose, you can take a look at my ZoomImage (https://github.com/panpf/zoomimage) library, which supports zooming, panning, positioning, rotation, super large image subsampling, and it also integrates Introduced image loaders such as glide, picasso, and coil |
Expected behaviour
SSIV is working as it does outside of jetpack compose.
Actual behaviour
SSIV freezes after some time when zooming in/out and dragging the image around. Then it does not respond to further gestures. More technically, onDraw() is no longer called once SSIV is frozen. Only when I call invalidate() from a button, SSIV moves again. But after that it freezes again pretty fast. This process can be repeated for as long as desired.
No exception or other warning occurs. For me personally it almost looks like SSIV is running in an infinite loop?
Steps to reproduce
Affected devices
Tested on Pixel 3, emulator
Affected images
All images
Many thanks.
The text was updated successfully, but these errors were encountered: