ImageViewZoom
ImageViewZoom copied to clipboard
This view intercepts all touch events
I am using the image view with MATCH_PARENT width and height. I also have floating buttons on top of the image. The buttons box auto-hides and works with gestures. The problem is even if I override the activity's onTouchEvent the image will always intercept all touch events and doesn't dispatch to other listeners. so I had to set the images touch listener to detect the gesture and the passed view's touch event as a workaround
For anyone that finds this in the future and doesn't understand right away, set a new onTouchListener then call onTouchEvent on the image:
mImageView.setOnTouchListener(new ImageViewTouch.OnTouchListener(){
public boolean onTouch(View v, MotionEvent event){
// do stuff
mImageView.onTouchEvent(event);
}
}