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

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

android - How to create dynamically Fragment pager adapter -

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