Java OpenResty Spring Spring Boot MySQL Redis MongoDB PostgreSQL Linux Android Nginx 面试 小程序 Arthas JVM AQS juc Kubernetes Docker 诊断工具


Android 揭露效果 Reveal Effect

Android 大约 591 字

示例

Reveal effect.gif

代码

public void effect(View view) {
        Animator animation = createAnimation(mView);
        animation.start();
 }

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public Animator createAnimation(View v) {
    Animator animator;
    double r = Math.hypot(v.getWidth(), v.getHeight());
    animator = ViewAnimationUtils.createCircularReveal(
            v,// 操作的视图
            0,// 动画开始的中心点X
            0,// 动画开始的中心点Y
            0,// 动画开始半径
            (float) r);// 动画结束半径

    animator.setInterpolator(new DecelerateInterpolator());
    animator.setDuration(1500);
    return animator;
}
阅读 2458 · 发布于 2019-04-12

————        END        ————

Give me a Star, Thanks:)

https://github.com/fendoudebb

扫描下方二维码关注公众号和小程序↓↓↓

扫描二维码关注我
昵称:
随便看看 换一批