zoukankan      html  css  js  c++  java
  • 解析AndroidProject 启动闪屏页动画 lottie json动画

    • 参考博文

       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.comhttps://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();
                }
            });
  • 相关阅读:
    猫树
    单位根反演
    区间修改区间求和
    最远点 决策单调性
    圆方树
    912. 排序数组
    1309. 解码字母到整数映射
    28. 实现 strStr()
    31. 下一个排列
    22. 括号生成
  • 原文地址:https://www.cnblogs.com/xqz0618/p/14914714.html
Copyright © 2011-2022 走看看