Hi
I have a set of views to be distributed to their respective parent
layouts. I need to animate the movement from the source layout to
their parent layout. I created a AnimationSet to do this, but the
animations are too jerky. Total number of views are 50. Each only the
last 4-5 view movements look smooth. What might be the issue. How else
can i do it to get a smooth effect.
This is the code snippet:
AnimationSet animSet = new AnimationSet(true);
for (int i = 0; i < INITIAL_NOOFVIEWS; i++) {
View child = mColumns[i %
NO_OF_COLUMNS].getChildAt(i/10);
child.getLocationInWindow(to);
Log.d(getClass().getName(), "column "+to[0]+" "+to[1]);
TranslateAnimation animCard = new
TranslateAnimation(TranslateAnimation.ABSOLUTE, 0,//from[0],
TranslateAnimation.ABSOLUTE, 0,//to[0],
TranslateAnimation.ABSOLUTE, from[1],
TranslateAnimation.ABSOLUTE, to[1] - 24);
animCard.setDuration(500);
animCard.setStartOffset(i*250);
child.setAnimation(animCard);
animSet.addAnimation(animCard);
}
animSet.setInterpolator(new AccelerateInterpolator());
animSet.startNow();
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en