Android ScrollView Intercepts Clicks, should not do that -
i have view onclicklistener inside of scrollview. view should react on clicks, scrollview interpretes touches action_move , intercepts touch events, cannot click view.
i have modified scrollview follows (because in viewpager , needs disable scrolling viewpager)
@override public boolean onintercepttouchevent(motionevent p_event) { if (p_event.getaction() == motionevent.action_move) { return true; } return super.onintercepttouchevent(p_event); } @override public boolean ontouchevent(motionevent p_event) { if (p_event.getaction() == motionevent.action_move && getparent() != null) { getparent().requestdisallowintercepttouchevent(true); } return super.ontouchevent(p_event); } how can change sensitivity of scrollview not register tiniest movements action_move , pass touch events children?
thanks help!
nevermind, fixed it! first part not necessary, if modify code follows works fine:
@override public boolean onintercepttouchevent(motionevent p_event) { /*if (p_event.getaction() == motionevent.action_move) { return true; }*/ return super.onintercepttouchevent(p_event); } @override public boolean ontouchevent(motionevent p_event) { if (p_event.getaction() == motionevent.action_move && getparent() != null) { getparent().requestdisallowintercepttouchevent(true); } return super.ontouchevent(p_event); }
Comments
Post a Comment