Creates a material style circular reveal entrance animation similar to the one in Google Play. - Android Animation

Android examples for Animation:Animation to Show

Description

Creates a material style circular reveal entrance animation similar to the one in Google Play.

Demo Code


import android.animation.Animator;
import android.annotation.TargetApi;
import android.view.View;
import android.view.ViewAnimationUtils;

public class Main {
  /**// w  ww  .ja  v a2 s .c  o  m
   * Creates a material style circular reveal entrance animation similar to the
   * one in Google Play.
   * 
   * @param view
   *          your view.
   */
  @TargetApi(21)
  public static void circularRevealEnter(View view) {
    int cx = view.getWidth() / 2;
    int cy = view.getHeight() / 2;

    float finalRadius = (float) Math.hypot(cx, cy);

    Animator anim = ViewAnimationUtils.createCircularReveal(view, cx, cy, 0, finalRadius);

    view.setVisibility(View.VISIBLE);
    anim.start();
  }
}

Related Tutorials