android - Overriding scrolling method of ScrollView for handling horizontal sliding events -


i want override scrolling method (i don't know function uses handle scrolling) of scrollview edittext (with vertical scrollbar) inside scroll vertically when change of y coordinate (for sliding finger/pointer) greater. , if change of x coordinate greater function called.

how can it? here code structure clarification.

@override public void scrollerfunction(alistener){     public void actionperformed(params)         if(abs(starty-endy) >= abs(startx-endx))             //scrollup or scrolldown         else             anotherfunction(); } 

you can override onscrollchanged method.

you can try --->

@override public void onscrollchanged (int l, int t, int oldl, int oldt){    // l current horizontal scroll origin.    // t current vertical scroll origin.    // oldl  previous horizontal scroll origin.    // oldt  previous vertical scroll origin.    if(abs(oldt-t) >= abs(oldl-l))      //scrollup or scrolldown    else      anotherfunction(); } 

give try. don't know if works.

source


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -