Skip to content
This repository was archived by the owner on Apr 17, 2019. It is now read-only.

fix onClickListener not fired - #11

Open
linsea wants to merge 1 commit into
sprylab:masterfrom
linsea:patch-1
Open

fix onClickListener not fired#11
linsea wants to merge 1 commit into
sprylab:masterfrom
linsea:patch-1

Conversation

@linsea

@linsea linsea commented Mar 9, 2016

Copy link
Copy Markdown

fix onClickListener not fired after set

fix onClickListener not fired after set
@rzimmer

rzimmer commented Mar 9, 2016

Copy link
Copy Markdown
Contributor

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...

@linsea

linsea commented Mar 15, 2016

Copy link
Copy Markdown
Author

@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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants