Browse Source

引导页完成引导

zk 1 year ago
parent
commit
8369f71d5a

BIN
app/src/main/assets/anim/splash.zip


+ 4 - 0
app/src/main/java/com/atmob/voiceai/module/splash/SplashActivity.java

@@ -1,5 +1,7 @@
 package com.atmob.voiceai.module.splash;
 
+import android.animation.Animator;
+import android.animation.AnimatorListenerAdapter;
 import android.animation.ValueAnimator;
 import android.annotation.SuppressLint;
 import android.os.Bundle;
@@ -91,8 +93,10 @@ public class SplashActivity extends BaseActivity<ActivitySplashBinding> {
         ValueAnimator alphaAnimator = ValueAnimator.ofFloat(0f, 1f);
         alphaAnimator.setStartDelay(400);
         alphaAnimator.setDuration(800);
+        new Handler().postDelayed(() -> binding.lottieGuide.playAnimation(), 400);
         alphaAnimator.addUpdateListener(animation -> {
             float alpha = (float) animation.getAnimatedValue();
+            binding.lottieBox.setAlpha(alpha);
             binding.tvPracticalFunny.setAlpha(alpha);
             binding.tvPractical.setAlpha(alpha);
             binding.tvGuideDone.setAlpha(alpha);

+ 16 - 0
app/src/main/res/layout/activity_splash.xml

@@ -130,6 +130,22 @@
                 app:layout_constraintTop_toBottomOf="@+id/space3"
                 tools:visibility="gone" />
 
+            <FrameLayout
+                android:alpha="0"
+                android:id="@+id/lottie_box"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent">
+
+                <com.airbnb.lottie.LottieAnimationView
+                    android:id="@+id/lottie_guide"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:adjustViewBounds="true"
+                    app:lottie_autoPlay="false"
+                    app:lottie_fileName="anim/splash.zip"
+                    app:lottie_loop="true" />
+
+            </FrameLayout>
 
             <View
                 android:id="@+id/v_guide_mask"