Slide 29
Slide 29 text
ViewAnimator
AnimatorSet animSet = new AnimatorSet();
animSet.playTogether(
ObjectAnimator.ofFloat(image, View.TRANSLATION_Y, -1000,0),
ObjectAnimator.ofFloat(image, View.ALPHA, 0,1),
ObjectAnimator.ofFloat(text, View.TRANSLATION_X, -200,0)
);
animSet.setInterpolator(new DescelerateInterpolator());
animSet.setDuration(2000);
animSet.addListener(new AnimatorListenerAdapter() {
@Override public void onAnimationEnd(Animator animation) {
AnimatorSet anim = new AnimatorSet();
anim.playTogether(
ObjectAnimator.ofFloat(image, View.SCALE_X, 1f, 0.5f, 1f),
ObjectAnimator.ofFloat(image, View.SCALE_Y, 1f, 0.5f, 1f)
);
anim.setInterpolator(new AccelerateInterpolator());
anim.setDuration(1000);
anim.start();
}
});
animSet.start();