F
Feuerstern
Fortgeschrittenes Mitglied
- 28
Hallo Leute,
Ist es bedenklich aus einem Animator listener heraus einen zweiten Animator zu starten?
mit freundlichen Grüßen
Feuerstern
Ist es bedenklich aus einem Animator listener heraus einen zweiten Animator zu starten?
Code:
final Animator animator1 = ObjectAnimator.ofFloat(view, "rotationY", 0.f, 90.f);
animator1.setDuration(1800);
// Rotate from 270 to 360 instead of 90 to 180 so the drawable is shown correct and not mirrored
final Animator animator2 = ObjectAnimator.ofFloat(view, "rotationY", 270.f, 360.f);
animator2.setDuration(1800);
final AnimatorSet animatorSetScaleIn = new AnimatorSet();
mAnimatorScaleIn.playTogether(
ObjectAnimator.ofFloat(imageView, "scaleX", 0.0f, 0.8f),
ObjectAnimator.ofFloat(imageView, "scaleY", 0.0f, 0.8f)
);
animatorSetScaleIn.setDuration(3600);
animator1.addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
}
@Override
public void onAnimationEnd(Animator animation) {
animator2.start();
animatorSetScaleIn.start();
}
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationRepeat(Animator animation) {
}
});
mit freundlichen Grüßen
Feuerstern