Egis
Egis

Reputation: 5141

Android RecyclerView circular reveal animation

How to implement RecyclerView ItemAnimator so that when the new item is added it appears with circular reveal animation like in the example below.

https://media.giphy.com/media/xT9IgIHforlj3uTwD6/giphy.gif

Upvotes: 0

Views: 566

Answers (1)

Campino
Campino

Reputation: 862

En el onClick even you can call to circularReveal:

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
   public static void circularReveal(View v){
       if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
           int finalRadius = Math.max(v.getWidth(), v.getHeight()) / 2;
           TransitionManager.beginDelayedTransition((ViewGroup) v);
           Animator anim = ViewAnimationUtils.createCircularReveal(v, v.getWidth() / 2, v.getHeight() / 2, 0, finalRadius);
           anim.start();
       }
   }

Upvotes: 1

Related Questions