On my layout, I have a ScrollView which hosts a VideoView and other TextViews.
My VideoView has a onTouch listener to start playing the video:
viPlayer.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
if (isPlaying) {
isPlaying = false;
viPlayer.stopPlayback();
} else {
isPlaying = true;
viPlayer.start();
}
return false;
}
});
The problem I am facing is this: when the user puts the finger above the VideoView
and starts to scroll down the ScrollView
, the video starts to play. I want that when a Scroll is performed, the child views of ScrollView
should not do anything. I see there is no listener for onScroll for ScrollView. How can I fix this?