if (mAnimator != null) {
mAnimator.cancel();
}
final int w = mDetail.getWidth() - x;
final int h = mDetail.getHeight() - y;
int r = (int) Math.ceil(Math.sqrt(x * x + y * y));
r = (int) Math.max(r, Math.ceil(Math.sqrt(w * w + y * y)));
r = (int) Math.max(r, Math.ceil(Math.sqrt(w * w + h * h)));
r = (int) Math.max(r, Math.ceil(Math.sqrt(x * x + h * h)));
if (in) {
mAnimator = ViewAnimationUtils.createCircularReveal(mDetail, x, y, 0, r);
} else {
mAnimator = ViewAnimationUtils.createCircularReveal(mDetail, x, y, r, 0);
}
mAnimator.setDuration((long)(mAnimator.getDuration() * 1.5));
if (listener != null) {
mAnimator.addListener(listener);
}
if (in) {
mBackground.startTransition((int)(mAnimator.getDuration() * 0.6));
mAnimator.addListener(mVisibleOnStart);
} else {
mDetail.postDelayed(mReverseBackground, (long)(mAnimator.getDuration() * 0.65));
mAnimator.addListener(mGoneOnEnd);
}
mAnimator.start();