Actions Of Horizontalscrollview Inside Viewpager
Solution 1:
implementing onTouch
and onClick
will consume the touch event by onTouch
and consider it consumed and not pass it on to the other various touch handlers which make your onClickListener
useless.
the Documentation:
onTouch() - This returns a boolean to indicate whether your listener consumes this event. The important thing is that this event can have multiple actions that follow each other. So, if you return false when the down action event is received, you indicate that you have not consumed the event and are also not interested in subsequent actions from this event. Thus, you will not be called for any other actions within the event, such as a finger gesture, or the eventual up action event.
here is some of the available solutions to handle this situation:
1-you can use onToach
and onClick
as an inner classes instead of implementing each listener.
2- you can use onToach
to detect a tab event:
if (gestureDetector.onTouchEvent(arg)) {
// single tapreturntrue;
} else {
// action up or down code
}
Post a Comment for "Actions Of Horizontalscrollview Inside Viewpager"