1

I have this kind of use-case

User is looking at ImageView, this ImageView should implement two types of gestures:

  • Swipe left/right to move to previous/next image
  • Zoom image (two-fingers, double-tap)

For swipe I've used implementation from here https://stackoverflow.com/a/8806468/492624
You can see it here: https://github.com/smarek/Simple-Dilbert/blob/master/src/com/mareksebera/dilbert/ActivitySwipeDetector.java

For double-tap, two-fingers I've used library named PhotoView
You can see it here: https://github.com/smarek/Simple-Dilbert/blob/master/src/com/mareksebera/dilbert/ImageZoomActivity.java

The problem is, I'm not currently able to combine these two implementations.
I'd like user to have both options on one page, one idea is to rewrite it from "single ImageView" to "ViewPager", to implement paging on lower level (not as OnTouchListener) and use PhotoView as library to provide zoom function.

Possible user-scenario is for me:

  • If image is not zoomed, user can use swipe gestures to move through images
  • If image is zoomed, user can work with zoom and move in zoomed image, but left-right swipe will not work in this case, so user will be forced to un-zoom it to be able to display another

So two qeustions are on the table

  1. Whether my user-scenario is right and understandable
  2. If there is option to combine these or use another library without need to rewrite it to ViewPager
4

1 回答 1

3

您不能只使用 PhotoView 示例中的代码吗?

这对我很有效:https: //play.google.com/store/apps/details?id=uk.co.senab.photoview.sample

于 2013-05-14T21:54:55.487 回答