Я создаю анимацию с AnimatorSet
, и когда она заканчивается, я хотел бы оставить View
там, где она была.
Код выглядит примерно так:
mLastAnimation = new AnimatorSet();
mLastAnimation.playTogether(
ObjectAnimator.ofFloat(mImageView, "scaleX", 1.5f, 1f),
ObjectAnimator.ofFloat(mImageView, "translationY", 40f, 0f));
mLastAnimation.setDuration(3000);
mLastAnimation.addListener(this);
mLastAnimation.start();
// The Activity implements the AnimatorListener interface
@Override
public void onAnimationEnd(Animator animator) {
// Undo the animation changes to the view.
}
EDIT:
Я использую новый API анимации, поэтому setFillAfter()
здесь не работает.