Reversing an Animation

No, sadly you cannot do it with the Animation object.
But you can simulate it using an interpolator that will inverse the animation:

package com.example.android;

import android.view.animation.Interpolator;

public class ReverseInterpolator implements Interpolator {
    @Override
    public float getInterpolation(float paramFloat) {
        return Math.abs(paramFloat -1f);
    }
}

Then on your animation you can set your new interpolator:

myAnimation.setInterpolator(new ReverseInterpolator());

Leave a Comment