I'm trying to emulate the Google Plus application in my project, as it is now a link.
The listview effect on scrolling is really good, and I would like to do something like this.
I started with LayoutAnimationController http://android-er.blogspot.be/2009/10/listview-and-listactivity-layout.html
LayoutAnimationController controller = AnimationUtils.loadLayoutAnimation( this, R.anim.list_layout_controller); getListView().setLayoutAnimation(controller);
and this seems bad, because not all elements are animated:
So, I ended up using the getView adapter and using this:
AnimationSet set = new AnimationSet(true); Animation animation = new AlphaAnimation(0.0f, 1.0f); animation.setDuration(800); set.addAnimation(animation); animation = new TranslateAnimation( Animation.RELATIVE_TO_SELF, 0.0f,Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 1.0f,Animation.RELATIVE_TO_SELF, 0.0f ); animation.setDuration(600); set.addAnimation(animation); row.startAnimation(set);
The result is amazing, and I'm really happy with it!
Unfortunately, it only works when scrolling from top to bottom of a list!
I want to make it work while scrolling on the other hand, I need to change TranslateAnimation a bit.
So my question is, is there a way to determine if I am scrolling up or down in my adapter?
android listview scroll animation direction
Waza_Be Aug 24 '12 at 18:41 2012-08-24 18:41
source share