实现漂亮的Activity或者Fragment切换效果:android-player
efbb
9年前
介绍:
实现漂亮的Activity或者Fragment切换效果,兼容api12
运行效果:
使用说明:
你创建了一个漂亮的UI,但是它很单调
运行这个player可以在进入Activity或者Fragment的时候为view创建漂亮的过渡效果。
将它放到Activity的onCreate()或者Fragment的onViewCreated()中。
Player.init(). animate(headerAction). then(). animate(fabAction). then(). animate(bottomAction). play();
效果:
其中的三个action分别是这样定义的:
final PropertyAction fabAction = PropertyAction.newPropertyAction(activityMainPinkFab). scaleX(0). scaleY(0). duration(750). interpolator(new AccelerateDecelerateInterpolator()). build(); final PropertyAction headerAction = PropertyAction.newPropertyAction(activityMainheaderLayout). interpolator(new DecelerateInterpolator()). translationY(-200). duration(550). alpha(0.4f). build(); final PropertyAction bottomAction = PropertyAction.newPropertyAction(activityMainMobileNumberLayout). translationY(500). duration(550). alpha(0f). build();
自定义
要自定义action,只需继承BaseAction并实现下面的两个方法。
void init(final View view); void animate(final View view);
下载
dependencies { compile 'com.eftimoff:androidplayer:1.0.0@aar' }
随心所欲的制作属于你的动画效果
项目主页:http://www.open-open.com/lib/view/home/1430966312382