ImageViewZoom icon indicating copy to clipboard operation
ImageViewZoom copied to clipboard

This view intercepts all touch events

Open wisammechano opened this issue 8 years ago • 1 comments

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

wisammechano avatar Nov 27 '17 23:11 wisammechano

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);
    }
}

mf16 avatar Dec 05 '18 01:12 mf16