Android - combine wipes and a pinch

Now I would like to combine both of them.

The problem is that swipe events are consumed by ImageViewTouch and skipped by the gallery.

How can I use events for both components?

This will solve my problem, because in the end, after several events, each component will know how to react accordingly. For example, if the first event is ACTION_DOWN , it may be part of the scaling or part of the scroll. Both components (Gallery and ImageViewTouch) must use it to know what to do in the following events.

+5
android imageview gallery swipe pinchzoom
source share
1 answer

I combined both components by changing the code in ImageViewZoom. The change was for events to return a value if they were used by ImageViewTouch. If so, the event should not be transferred to the gallery. If the event is not consumed by ImageView, then the gallery should consume it (if possible).

There are still small problems, but they are functional. Hope other people in the community can help.

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

Thanks.

+3
source share

All Articles