Android Scroll to bottom finish event -


i have simple class extends scrollview , want call listener when scroll finish on bottom, code when scroll finish on top , bottom call interface listener, call on bottom finish

@override protected void onscrollchanged(int x, int y, int oldx, int oldy) {     super.onscrollchanged(x, y, oldx, oldy);     (onscrollchangedlistener oscl : onscrollchangedlisteners) {         oscl.onverticalscrollchanged(y);     }     if (mscrollstoppedlistener != null && y != oldy) {         checkifstopped();     } } 

how detect scrolling on bottom in method ? wroted if not correct , not detect correctly scrolling down

solved problem code.

view view = (view) getchildat(getchildcount()-1); int diff = (view.getbottom()-(getheight()+getscrolly()+view.gettop())); if( diff == 0 ){     log.i("scrollview: ", " finished on bottom of screen"); } 

Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -