show Reveal Effect - Android android.view.animation

Android examples for android.view.animation:Show Animation

Description

show Reveal Effect

Demo Code

import android.animation.Animator;
import android.support.annotation.Nullable;
import android.view.View;
import android.view.ViewAnimationUtils;

public class Main{

    public static final int REVEAL_DURATION = 500;
    public static void showRevealEffect(final View v, int centerX,
            int centerY, @Nullable Animator.AnimatorListener lis) {

        v.setVisibility(View.VISIBLE);

        int finalRadius = Math.max(v.getWidth(), v.getHeight());

        Animator anim = ViewAnimationUtils.createCircularReveal(v, centerX,
                centerY, 0, finalRadius);

        anim.setDuration(REVEAL_DURATION);

        if (lis != null)
            anim.addListener(lis);/* ww w. j  a  v  a2 s .c  o m*/

        anim.start();
    }

}

Related Tutorials