Android 揭露效果 Reveal Effect

Android About 591 words

示例

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;
}
Views: 2,572 · Posted: 2019-04-12

————        END        ————

Give me a Star, Thanks:)

https://github.com/fendoudebb/LiteNote

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

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


Today On History
Browsing Refresh