Search code examples
androidandroid-layoutandroid-animationandroid-viewcircularreveal

How to animate movement of android circular reveal animation


I'm using reveal animation in api 21 to above, to animate view revealing with nice circular animation.

But when I try to animate the position of the view, Circular reveal animation will not animate correctly and show's wrong frames (miss behavior with margins!).

I'm using ValueAnimator and update view margins in its updateListener for translation.

I'm looking for the best practice to play moving animation parallel with circular reveal animation.


Solution

  • Finally figured it out !

    Using ViewPropertyAnimator solved the problem.

    final Animator anim = ViewAnimationUtils
       .createCircularReveal(animatedView, startPos[0], startPos[1], initRadius, targetRadius);
    myView.animate().x(100).y(100);
    anim.start();