texturevideoview icon indicating copy to clipboard operation
texturevideoview copied to clipboard

fix onClickListener not fired

Open linsea opened this issue 8 years ago • 2 comments

fix onClickListener not fired after set

linsea avatar Mar 09 '16 13:03 linsea

Thanks for your contribution! I don't get why we can't just return false!? onTouchEvent clearly states that false indicates the system that the event was not (fully) handled...

rzimmer avatar Mar 09 '16 16:03 rzimmer

@rzimmer onClickListener.onClick() is performed in super.onTouchEvent(ev), you can test it by setting a onClickListener for TextureVideoView. I saw the system VideoView has the same problem, maybe it was designed for some reasons(MediaController?) So, if not modification for being consistent with the native design and in case some one meet the same issue, here is my way bypassing this problem:

`

    textureVideoView.setOnTouchListener(new View.OnTouchListener() {

        @Override
        public boolean onTouch(View view, MotionEvent motionEvent) {

            if (motionEvent.getAction() == MotionEvent.ACTION_UP) {
                     //myPerformOnClick();  //onClick logic here
             }

            return false;

        }
    });

` hope it helps.

linsea avatar Mar 15 '16 10:03 linsea