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.
Comments
Post a Comment