package me.mattlogan.pancakes;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.view.View;
import android.view.ViewAnimationUtils;

import me.mattlogan.library.PushAnimation;

public class CircularReveal implements PushAnimation {

    @Override
    public void animate(View view, final PushAnimation.Callback callback) {
        // get the center for the clipping circle
        int cx = view.getWidth() / 2;
        int cy = view.getHeight() / 2;

        // get the final radius for the clipping circle
        int finalRadius = Math.max(view.getWidth(), view.getHeight());

        // create the animator for this view (the start radius is zero)
        Animator anim = ViewAnimationUtils.createCircularReveal(view, cx, cy, 0, finalRadius);

        // make the view visible and start the animation
        view.setVisibility(View.VISIBLE);

        anim.addListener(new AnimatorListenerAdapter() {
            @Override
            public void onAnimationEnd(Animator animation) {
                callback.animationDone();
            }
        });

        anim.start();
    }
}

@@ -795,108 +795,8 @@
 );%0A%0A
-        // make the view visible and start the animation%0A        view.setVisibility(View.VISIBLE);%0A%0A
     

Update CircularReveal animation