https://www.cnblogs.com/lennon-wechat/p/lottie.html
https://www.jianshu.com/p/282d098cf928?utm_source=oschina-app
- 官网动画实例 www.lottiefiles.com
- AE文件预览 https://www.lottiefiles.com/preview
implementation 'com.airbnb.android:lottie:2.0.1'
<com.airbnb.lottie.LottieAnimationView
android:id="@+id/animation_view"
android:layout_width="match_parent"
android:layout_height="80dp"/>
将下载的aaa.json放在main/assets文件夹下
LottieAnimationView animationView = findViewById(R.id.animation_view);
animationView.setAnimation("aaa.json");
// animationView.loop(true);//循环播放动画,已经废弃,但是还可以使用,建议使用下面的两行代码
animationView.setRepeatMode(LottieDrawable.REVERSE);//设置播放模式
animationView.setRepeatCount(LottieDrawable.INFINITE);//设置重复次数
animationView.playAnimation();