材质颜色飞溅库(Material color splash lib)

编程入门 行业动态 更新时间:2024-10-25 03:25:16
材质颜色飞溅库(Material color splash lib)

也许一周前,我发现了用彩色和动画填充视图的lib。

现在我找不到它,也许有人找到了它?

这是我的意思的例子。 需要与删除时的计算器相同,或者在开始调用时使用拨号器。

Maybe a week ago I found lib wich fill view with color and animation.

Now I cant find it, maybe someone sought it?

Here is example of what I mean. Need the same as in calculator on delete, or dialer on start calling.

最满意答案

我发现它是Android 21的Reveal Effect。

要做到这一点,我只需要使用此代码

// previously invisible view View myView = findViewById(R.id.my_view); // get the center for the clipping circle int cx = (myView.getLeft() + myView.getRight()) / 2; int cy = (myView.getTop() + myView.getBottom()) / 2; // get the final radius for the clipping circle int finalRadius = Math.max(myView.getWidth(), myView.getHeight()); // create the animator for this view (the start radius is zero) Animator anim = ViewAnimationUtils.createCircularReveal(myView, cx, cy, 0, finalRadius); // make the view visible and start the animation myView.setVisibility(View.VISIBLE); anim.start();

从这里开始使用显露效果

I found that it was Reveal Effect from Android 21.

To do like this I just need to use this code

// previously invisible view View myView = findViewById(R.id.my_view); // get the center for the clipping circle int cx = (myView.getLeft() + myView.getRight()) / 2; int cy = (myView.getTop() + myView.getBottom()) / 2; // get the final radius for the clipping circle int finalRadius = Math.max(myView.getWidth(), myView.getHeight()); // create the animator for this view (the start radius is zero) Animator anim = ViewAnimationUtils.createCircularReveal(myView, cx, cy, 0, finalRadius); // make the view visible and start the animation myView.setVisibility(View.VISIBLE); anim.start();

Take from here Use the Reveal Effect

更多推荐

lib,也许,电脑培训,计算机培训,IT培训"/> <meta name="description" cont

本文发布于:2023-07-29 14:11:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1316780.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:材质   颜色   Material   lib   splash

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!