` void CloseView(){
// get the center for the clipping circle
int cx = (revealView.getLeft() + revealView.getRight()) / 2;
int cy = (revealView.getTop() + revealView.getBottom()) / 2;
// get the final radius for the clipping circle
int dx = Math.max(cx, revealView.getWidth() - cx);
int dy = Math.max(cy, revealView.getHeight() - cy);
float finalRadius = (float) Math.hypot(dx, dy);
// Android native animator
Animator animator =
ViewAnimationUtils.createCircularReveal(revealView, cx, cy, 0, 0, View.LAYER_TYPE_HARDWARE);
animator.setInterpolator(new FastOutSlowInInterpolator());
animator.setDuration(500);
animator.start();
animator.addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animator) {
}
@Override
public void onAnimationEnd(Animator animator) {
parentView.setVisibility(View.GONE);
}
@Override
public void onAnimationCancel(Animator animator) {
}
@Override
public void onAnimationRepeat(Animator animator) {
}
});
IsOpen = false;
}
I have no reverse() method in Animator object
` void CloseView(){ // get the center for the clipping circle int cx = (revealView.getLeft() + revealView.getRight()) / 2; int cy = (revealView.getTop() + revealView.getBottom()) / 2;