Example usage for android.animation AnimatorListenerAdapter onAnimationStart

List of usage examples for android.animation AnimatorListenerAdapter onAnimationStart

Introduction

In this page you can find the example usage for android.animation AnimatorListenerAdapter onAnimationStart.

Prototype

@Override
public void onAnimationStart(Animator animation) 

Source Link

Usage

From source file:Main.java

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public static void show(final View view, final int cornerType, int normalAnimRes,
        final AnimatorListenerAdapter listener) {
    try {//from w  w  w  .  j  a va2s  .c om
        int[] amaya = calulateCorner(view, cornerType);
        Animator anim = ViewAnimationUtils.createCircularReveal(view, amaya[0], amaya[1], 0, amaya[2]);
        anim.setInterpolator(new LinearInterpolator());
        anim.setDuration(300);
        anim.addListener(new AnimatorListenerAdapter() {
            @Override
            public void onAnimationStart(Animator animation) {
                super.onAnimationStart(animation);
                view.setVisibility(View.VISIBLE);
                if (listener != null) {
                    listener.onAnimationStart(animation);
                }
            }

        });
        anim.start();
    } catch (Exception e) {
        e.printStackTrace();
        view.setVisibility(View.VISIBLE);
    }
}