Reveal Effect(揭露效果)

2017-12-29  本文已影响94人  咸鱼Jay

介绍:

揭露动画:就是为了当你在显示或者隐藏一个view的时候为用户提供一个视觉上连续性的动画效果。

使用ViewAnimationUtil工具类可以实现揭露动画

API解释:

ViewAnimationUtils.createCircularReveal(
            view, //作用在哪个View上面
            centerX, centerY,//扩散的中心点
            startRadius, //开始扩散初始半径
            endRadius)//扩散结束半径
从中心到四周显示
 Animator animator = ViewAnimationUtils.createCircularReveal(ivBelle,//作用在哪个View上面
        ivBelle.getWidth()/2, ivBelle.getHeight()/2, //扩散的中心点
        0,//开始扩散初始半径
        ivBelle.getHeight());//扩散结束半径
animator.setDuration(1000);
animator.setInterpolator(new AccelerateInterpolator());
animator.start();
从某一个角到对角
 Animator animator = ViewAnimationUtils.createCircularReveal(ivBelle2,
        0, 0,
        0,
        (float)Math.hypot(ivBelle2.getWidth(),
        ivBelle2.getHeight()));
animator.setDuration(1000);
animator.setInterpolator(new AccelerateInterpolator());
animator.start();

效果图:

揭露动画
上一篇下一篇

猜你喜欢

热点阅读