fling and pinchzoom for an imageview in one activity
Asked Answered
A

4

8

I have an Imageview(like a Magazine page).When i swype in to that image then i want the next image(page).Also want Zoom in and out option for this image.How i can achieve this?

Thanks

Avram answered 16/2, 2012 at 10:27 Comment(5)
Check this article: ImageView Zoom and Scroll.Silverpoint
I guess you are looking for a library that does that.Victoria
See duplicate of this: #8976086Victoria
Possible duplicate: #11672710Victoria
check my ans: https://mcmap.net/q/1471356/-zoom-and-mask-using-glideVerlinevermeer
B
3

Assuming you already researched separately on pinch-to-zoom and swipe gestures, you may want to impose limitations on useability. When the image is zoomed (occupying an area greater than the screen size), you should disable swipe detection, and enable it again once the image size is less than the screen size.

Bridgettebridgewater answered 16/2, 2012 at 10:44 Comment(3)
how can i detect whether it is a pinch zoom or swype gesture?Avram
in detecting pinch zoom, you're using MotionEvent.ACTION_POINTER_DOWN to detect the second finger touching the screen. while there's no MotionEvent.ACTION_UP, whatever the onTouchEvent is processing should be a pinch gesture. try setting up flags to enable/disable swipe detection. that of course, in support to checking for the size of the image, as mentioned in my answer.Bridgettebridgewater
But it contradicts the scroll gesture. Isn't there a more generic way doing this? I mean one component with pinch to zoom and scroll. Another with swipe and make them work together.Victoria
V
2

I implemented such a library. There are still minor issues but it's functional and can be extended.

Here's the fork on github: https://github.com/kilaka/ImageViewZoom

Enjoy.

Victoria answered 18/10, 2012 at 19:36 Comment(0)
V
0

Found this post on a a gallery (swipe between photos) with pinch-to-zoom.

Victoria answered 26/7, 2012 at 16:1 Comment(0)
S
0

I recently implemented it and it works great

https://github.com/chrisbanes/PhotoView

Silverpoint answered 15/3, 2013 at 6:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.