Android listview smothScrollBy with speed? -


is there way similar using smoothscrolltoposition control on speed or time takes scroll smoothly?

now using below snippet scrool pos

int firstvisible = lv.getfirstvisibleposition(); int lastvisible = lv.getlastvisibleposition();             if (firstvisible > pos)                 lv.smoothscrolltoposition(pos, pos - firstvisible - 2);             if (pos > lastvisible)                 lv.smoothscrolltoposition(pos, pos + lastvisible + 3); 

from this modified aabove snippet below

    int childheight = lv.getchildat(firstvisible).getheight();              if (firstvisible > pos)                 lv.smoothscrollby(childheight*pos, 800);             if (pos > lastvisible)                 lv.smoothscrollby(childheight*pos, 1200); 

but, nullpointer exceptions @

  int childheight = lv.getchildat(firstvisible).getheight(); 

edit

i in need of scrooling automatically childview button press user,say menu button. not facing problem of list scrolling because of doing resource intensive task populate listview. want functionality of smoothscrolltoposition smoothscrooltoposition velocity control


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -