anonymos
anonymos

Reputation: 187

on end listener for property animation

This question shows how you set listeners for an android view animation, but it doesn't work for property animations.

How can I achieve the same thing with a property animation?

my animation:

ViewPropertyAnimator viewPropertyAnimator = layout.animate().y(integer).setInterpolator(interpolator).setStartDelay(delay).setDuration(duration);

Upvotes: 3

Views: 3255

Answers (1)

shhp
shhp

Reputation: 3693

Try this:

viewPropertyAnimator.setListener(new Animator.AnimatorListener() {
                @Override
                public void onAnimationStart(Animator animation) {

                }

                @Override
                public void onAnimationEnd(Animator animation) {

                }

                @Override
                public void onAnimationCancel(Animator animation) {

                }

                @Override
                public void onAnimationRepeat(Animator animation) {

                }
            });

Upvotes: 9

Related Questions