用到两个插件:Bodymovin和Lottie

Bodymovin:AE插件  ,作用是把AE合成生成json文件。

Lottie:安卓端把json文件,解析成动画 并展现出来

Lottie使用方法 :

1.首先添加依赖:

compile 'com.airbnb.android:lottie:2.1.0'
2.布局文件添加:

<com.airbnb.lottie.LottieAnimationView
        android:id="@+id/animation_view"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:lottie_fileName="hello-world.json"
        app:lottie_loop="true"
        app:lottie_autoPlay="true" />

3.代码中:

LottieAnimationView animationView = (LottieAnimationView) findViewById(R.id.animation_view);
animationView.setAnimation("hello-world.json");
animationView.loop(true);
animationView.playAnimation();
这样就最简单的实现了一个AE动画在安卓中的显示。更多代码 看github:https://github.com/airbnb/lottie-android


利用插件制作安卓动画




相关文章:

  • 2022-01-12
  • 2022-12-23
  • 2022-12-23
  • 2021-12-10
  • 2021-12-31
  • 2021-12-23
  • 2021-12-24
猜你喜欢
  • 2021-11-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-17
  • 2021-04-06
相关资源
相似解决方案