Now I would like to combine them both.
The problem is that the swipe events get consumed by the ImageViewTouch and missed by the Gallery.
How can consume events by both components?
That would solve my problem, because, eventually, after a few events, each component will know how to react accordingly.
For example, if the first event is ACTION_DOWN, it can be part of a pinch-to-zoom or part of a swipe. Both components (Gallery and ImageViewTouch) should consume it in order to know what to do in following events.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…