android - Get scrollview on top event -
i have code on gridview on touch event.
gridview.setontouchlistener(new ontouchlistener() { @override public boolean ontouch(view v, motionevent event) { // todo auto-generated method stub int action = event.getaction(); switch (action) { case motionevent.action_down: // disallow scrollview intercept touch events. v.getparent().requestdisallowintercepttouchevent(true); break; case motionevent.action_up: // allow scrollview intercept touch events. v.getparent().requestdisallowintercepttouchevent(false); break; } // handle listview touch events. v.ontouchevent(event); return true; } });
inside motionevent.action_up
case, want this.
if(v.getparent().scrollisontop){ v.getparent().requestdisallowintercepttouchevent(false); } else{ v.getparent().requestdisallowintercepttouchevent(true); }
mean when parent scroll on top, disallow scrollview intercept
else allow scrollview intercept.
Comments
Post a Comment