android - Table - Conflict onTouchEvent and OnClickListener -
i have tablelayout hscroll , vscroll can scroll in directions. scrollable layout used: scrollview vertical , horizontal in android . uses ontouchevent.
there items in tablelayout onclicklistener.
when scroll in table , touch item onclicklistener scrolling not working. when click on item onclicklistener works fine. want scroll on these items when move gesture used.
how can solve conflict between ontouchevent , onclicklistener?
this ontouchevent:
@override public boolean ontouchevent(motionevent event) { switch (event.getaction()) { case motionevent.action_down: if(true) { mx = event.getx(); = event.gety(); } break; case motionevent.action_move: if(true) { curx = event.getx(); cury = event.gety(); vscroll.scrollby((int) (mx - curx), (int) (my - cury)); hscroll.scrollby((int) (mx - curx), (int) (my - cury)); mx = curx; = cury; } break; case motionevent.action_up: if(true) { curx = event.getx(); cury = event.gety(); vscroll.scrollby((int) (mx - curx), (int) (my - cury)); hscroll.scrollby((int) (mx - curx), (int) (my - cury)); } break; } return true; }
try returning false ontouchevent method, indicate android system didn't consume event , should continue passing through...
Comments
Post a Comment