作者:单身男人adgjm | 来源:互联网 | 2023-01-29 15:19
Lottie的json动画
AE制作Json动画教程

splash_activity.xml
<com.airbnb.lottie.LottieAnimationView
android:id="@+id/lav_splash_lottie"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="40dp"
app:lottie_autoPlay="true" //是否自动播放
app:lottie_loop="false" //是否循环播放
app:lottie_rawRes="@raw/welcome" />
动画资源 @raw/welcome

⭐是一个json动画,内容(此凡胎无法识别)


// 动画解析库:https://github.com/airbnb/lottie-android
// 动画资源:https://lottiefiles.com、https://icons8.com/animated-icons
implementation 'com.airbnb.android:lottie:3.6.1'
⭐启动页在动画播放结束之后,将进行跳转页面
mLottieView.addAnimatorListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
mLottieView.removeAnimatorListener(this);
//HomeActivity.start(getContext()); //Intent跳转
finish();
}
});