android_additive_animations
介绍:
一个比原生动画更简洁,更流畅的动画库,非常适合需要连续播放动画的场景
运行效果:
使用说明:
build.gradle
dependencies {
compile 'at.wirecube:additive_animations:1.3'
}
...
repositories {
jcenter()
}
Here is a sample of what additive animations can do to the user experience (note: there seem to be a few dropped frames in the gif which aren't present when running on a device):
这里以不断以触摸的点对view做动画来演示该库的叠加动画效果,下图分别是传统属性动画与Additive 动画在效果上的差异:
实现上面的效果只需非常简单的代码:
public boolean onTouch(View v, MotionEvent event) {
AdditiveAnimator.animate(animatedView).x(event.getX()).y(event.getY()).setDuration(1000).start();
return true;
}
另外,AdditiveAnimator还支持多view叠加动画:
new AdditiveAnimator().setDuration(1000)
.target(myView1).x(100).y(100)
.target(myView2).xBy(20).yBy(20)
.start();
已下载
0