In my application I have a custom View
(that extends ImageView
) and in it we handle the touch events to move Image.
Then I make ViewPager
to slide right or left to show the next layout.
The custom View
onTouchEvent
code works fine by itself. The ViewPager
code also works fine. However, if I add them both, my custom View
code for move image left or right stops working.
Here's the code for the OnTouchEvent
in the custom View
:
@Override
public boolean onTouchEvent(MotionEvent event) {
super.onTouchEvent(event);
switch (event.getAction() & MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_DOWN:
//TODO
break;
case MotionEvent.ACTION_MOVE:
//TODO
break;
case MotionEvent.ACTION_UP:
//TODO
break;
}
return true;
}
Hoping for any help!!!!!