Bodymovin(5.4.4_5.5.6) zxp插件下载
下载后修改文件zxp为zip解压插件放在ae目录下
打开AE 窗口-扩展-Bodymovin
导出json动画把文件加到assets下
使用代码
// 图片资源文件
animation_view.imageAssetsFolder = "img/images"
// 动画数据
animation_view.setAnimation("img/data.json")
// 循环播放
animation_view.repeatCount = -1
// 开始播放
animation_view.playAnimation()
布局文件
<com.airbnb.lottie.LottieAnimationView
android:id="@+id/animation_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
app:lottie_autoPlay="true"
app:lottie_fileName="biking_is_cool.json"
app:lottie_loop="true" />
lottie引入
implementation 'com.airbnb.android:lottie:3.4.0'