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

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -