Reverse Circular Reveal Effect
Closed this issue · 8 comments
aritraroy commented
Is it possible to create the reverse Circular Reveal effect?
ozodrukh commented
Yep,
View myView = findView(R.id.awesome_card);
// get the center for the clipping circle
int cx = (myView.getLeft() + myView.getRight()) / 2;
int cy = (myView.getTop() + myView.getBottom()) / 2;
// get the final radius for the clipping circle
int finalRadius = Math.max(myView.getWidth(), myView.getHeight());
// i just swapped from radius, to radius arguments
SupportAnimator animator =
ViewAnimationUtils.createCircularReveal(myView, cx, cy, finalRadius, 0);
animator.setInterpolator(new AccelerateDecelerateInterpolator());
animator.setDuration(1500);
animator.start();
aritraroy commented
Thanks a lot for it.
tounaobun commented
It does not work for me.
ozodrukh commented
checkout a latest version, i added reverse animation
aritraroy commented
I am just working with the solution that you gave me and its working just fine.
kai91 commented
If you're talking about the reverse function, you're supposed to use animator.reverse().start().
reverse() only returns the SupportAnimator and not start the animation itself.
ankitbatra11 commented
It's not working for me either. I am using the latest version and I have tried the animator.reverse.start() too.
codekidX commented
Ok I too had the reverse animator problem. Actually I was setting the view INVISIBLE after anim.start();
which does not wait for animation to end.
Solution:
anim.addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
}
@Override
public void onAnimationEnd(Animator animation) {
mConfigCard.setVisibility(View.INVISIBLE);
}
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationRepeat(Animator animation) {
}
});