android - manage fade in animation of listitems with onScrollStateChanged for a listview -
animate listview
items fade-in animation, onscrollstatechanged
,
i have been trying out below code
layoutanimationcontroller controller = animationutils.loadlayoutanimation( this, r.anim.anim2); getlistview().setlayoutanimation(controller); getlistview().setonscrolllistener(new onscrolllistener(){ public void onscroll(abslistview view, int firstvisibleitem, int visibleitemcount, int totalitemcount) { // todo auto-generated method stub } public void onscrollstatechanged(abslistview view, int scrollstate) { // todo auto-generated method stub if(scrollstate == 0) { layoutanimationcontroller controller = animationutils.loadlayoutanimation( mainactivity.this, r.anim.anim2); getlistview().setlayoutanimation(controller); } } }); }
how works
when load listview
, first items fade in
when scroll or down fade in effect applied items (visible) in list
what want
suppose have list of 20 items
now when list load first 10 items visible , fade in effect applied these 10
when scroll down visible list-items should stay is, , fade in effect should applied remaining items, invisible earlier, example, if scroll 15th item previous 5 items(from earlier 10)[which still visible] should stay are, , animation should applied remaining 5 (of total 15)[which visible]
what happens above code
the fade in effect if scroll down or applies items visible , including previous 5 items , next 5 items
my questions are
1) can identify items have been visible , animation has been completed them (and prevent animation being applied them)
2) apply animation remaining item visible
Comments
Post a Comment