martinwithaar / PinchToZoom

Android's ImageView pinch-to-zoom made easy
MIT License
110 stars 27 forks source link

Not working onClickListener #8

Open hope4T opened 6 years ago

hope4T commented 6 years ago

I tried to detect onClick event on imageView, but it is not working. How can I fix this issue?

Here is my code.

ImageMatrixTouchHandler imageMatrixTouchHandler = new ImageMatrixTouchHandler(imageView.getContext()); imageView.setOnTouchListener(imageMatrixTouchHandler);

    imageView.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            //do something
        }
    });
martinwithaar commented 6 years ago

I have pushed functionality for this to the develop branch. Add this line when you set a click listener to the image view:

imageMatrixTouchHandler.setConsumeTouchEvent(false);

All touch events should be available for click detection like this. The resulting behavior is however quite buggy. I'm looking into ways for making it work better.

hixfield commented 5 years ago

@martinwithaar any update on this? When will this be "generally" available?

EleshBaraiya commented 4 years ago

Can you update click event in master and update versoin ?