show Item With Animation - Android Animation

Android examples for Animation:Animation to Show

Description

show Item With Animation

Demo Code


import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ValueAnimator;
import android.os.Build;
import android.view.View;
import android.view.ViewAnimationUtils;

public class Main{
    public static void showItemWithAnim(final View mView, int cx, int cy,
            int mWidth) {

        if (Build.VERSION.SDK_INT >= 20) {
            ValueAnimator anim = ViewAnimationUtils.createCircularReveal(
                    mView, cx, cy, 0, mWidth);

            anim.addListener(new AnimatorListenerAdapter() {
                @Override/*from   w  w  w  . j  a v a  2  s  . c om*/
                public void onAnimationEnd(Animator animation) {
                    super.onAnimationEnd(animation);
                    mView.setVisibility(View.VISIBLE);
                }
            });

            anim.start();
        } else {
            mView.setVisibility(View.VISIBLE);
        }
    }
}

Related Tutorials