组合动画的一般用法
同时进行:
ObjectAnimator animator = ObjectAnimator.ofFloat(button,"rotationY",180); ObjectAnimator animator2 = ObjectAnimator.ofFloat(button,"translationY",500); AnimatorSet set = new AnimatorSet(); // 同时进行animator动画和animator2动画 set.playTogether(animator,animator2); // 等同于 set.play(animator).with(animator2); set.setDuration(5000); set.start();顺序进行:
ObjectAnimator animator = ObjectAnimator.ofFloat(button,"rotationY",180); ObjectAnimator animator2 = ObjectAnimator.ofFloat(button,"translationY",500); AnimatorSet set = new AnimatorSet(); // 先执行animator动画,animator动画结束后再执行animator2动画 set.playSequentially(animator,animator2); // 等同于set.play(animator).before(animator2); set.setDuration(5000); set.start();