Android使用使用Circular Reveal动画让页面跳转更炫酷动画让页面跳转更炫酷
本篇文章主要介绍了Android使用Circular Reveal动画让页面跳转更炫酷,具有一定的参考价值,有兴趣的可以
了解一下
Android 5.0中引入了很多炫酷的动画效果,Circular Reveal便是其中一种。使用起来很简单,但效果却是意想不到的炫酷,让
你的app更有逼格。
一、效果一、效果
废话不说,下面的gif图中使用Circular Reveal动画实现跳转到搜索页的效果。gif图压缩宽高比失真了,不过效果还在。源码在
最下面,可以下载体验下。
二、二、Circular Reveal介绍介绍
当您显示或隐藏一组 UI 元素时,揭露动画可为用户提供视觉连续性。
ViewAnimationUtils.createCircularReveal()方法让您能够为裁剪区域添加动画以揭露或隐藏视图。
/* @param view The View will be clipped to the animating circle.
* @param centerX The x coordinate of the center of the animating circle, relative to
* <code>view</code>.
* @param centerY The y coordinate of the center of the animating circle, relative to
* <code>view</code>.
* @param startRadius The starting radius of the animating circle.
* @param endRadius The ending radius of the animating circle.
*/
public static Animator createCircularReveal(View view,
int centerX, int centerY, float startRadius, float endRadius) {
return new RevealAnimator(view, centerX, centerY, startRadius, endRadius);
}
ViewAnimationUtils.createCircularReveal()方法所执行的效果,就是将一个View裁剪成圆,然后从圆心逐渐揭露展现视图。
参数参数 参数说明参数说明
view 要执行动画效果的View
centerX 圆心x坐标
centerY 圆心y坐标
startRadius 开始时的圆半径
endRadius 结束时的圆半径
三、实现三、实现
评论0
最新资源