texturevideoview
texturevideoview copied to clipboard
fix onClickListener not fired
fix onClickListener not fired after set
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 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.