美文网首页
Reveal Effect(揭露效果)

Reveal Effect(揭露效果)

作者: 咸鱼Jay | 来源:发表于2017-12-29 17:35 被阅读94次

    介绍:

    揭露动画:就是为了当你在显示或者隐藏一个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();
    

    效果图:

    揭露动画

    相关文章

      网友评论

          本文标题:Reveal Effect(揭露效果)

          本文链接:https://www.haomeiwen.com/subject/spgawxtx.html