プラグインによるアンドロイドアニメーションの作成
3398 ワード
2つのプラグインを使用します:BodymovinとLottie
Bodymovin:AEプラグインは、AEを合成してjsonファイルを生成する役割を果たします.
Lottie:安卓端はjsonファイルをアニメーションに解析して表現します
Lottieの使用方法:
1.依存関係を最初に追加:
3.コードの中:
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