Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This view intercepts all touch events #102

Open
wisammechano opened this issue Nov 27, 2017 · 1 comment
Open

This view intercepts all touch events #102

wisammechano opened this issue Nov 27, 2017 · 1 comment

Comments

@wisammechano
Copy link

wisammechano commented Nov 27, 2017

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

@mf16
Copy link

mf16 commented Dec 5, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants