public void reveal (float positionFromRight, int animationDuration) {
View revealingView = circularRevealViewContainer.getChildAt(0);
// start x-index for circular animation
int cx = revealingView.getWidth() - (int) (positionFromRight);
// start y-index for circular animation
int cy = (revealingView.getTop() + revealingView.getBottom()) / 2;
// calculate max radius
int dx = Math.max(cx, revealingView.getWidth() - cx);
int dy = Math.max(cy, revealingView.getHeight() - cy);
float finalRadius = (float) Math.hypot(dx, dy);
// Circular animation declaration begin
final Animator animator;
animator = io.codetail.animation.ViewAnimationUtils
.createCircularReveal(revealingView, cx, cy, 0, finalRadius);
animator.setInterpolator(new AccelerateDecelerateInterpolator());
animator.setDuration(animationDuration);
revealingView.setVisibility(View.VISIBLE);
animator.start();
}
CircularRevealLayout.java 文件源码
java
阅读 25
收藏 0
点赞 0
评论 0
项目:react-native-android-circular-reveal
作者:
评论列表
文章目录