【开源】android-player

android-player

使用说明:

你创建了一个漂亮的UI,但是它很单调

svg

运行这个player可以在进入Activity或者Fragment的时候为view创建漂亮的过渡效果。

将它放到Activity的onCreate()或者Fragment的onViewCreated()中。

1
2
3
4
5
6
7
Player.init().
    animate(headerAction).
    then().
    animate(fabAction).
    then().
    animate(bottomAction).
    play();

效果:

sample_one.gif

其中的三个action分别是这样定义的:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
    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并实现下面的两个方法。

1
2
3
    void init(final View view);
 
    void animate(final View view);

下载

1
2
3
dependencies {
    compile 'com.eftimoff:androidplayer:1.0.0@aar'
}

随心所欲的制作属于你的动画效果

 

 

相关代码

  • SmoothTransition
  • TimelyTextView
  • Android空气质量检测仪
  • ArcAnimator
  • Euclid

posted on 2015-05-08 13:26  wasdchenhao  阅读(318)  评论(0)    收藏  举报

导航