Selaa lähdekoodia

修改部分问题

Pq 1 vuosi sitten
vanhempi
commit
55b88519a6

+ 6 - 0
institution/src/main/java/com/cooleshow/institution/stu/ui/main/CardAnimFragment.java

@@ -19,6 +19,8 @@ public class CardAnimFragment extends BaseFragment<FgCardAnimLayoutBinding> {
     private String pageTypeValue = HomePageType.EMPTY.getType();
     private int mStatus;
 
+    private boolean isCanPlay =false;
+
     public static CardAnimFragment newInstance(int type, String typeValue, int status) {
         Bundle bundle = new Bundle();
         bundle.putInt("type", type);
@@ -73,9 +75,13 @@ public class CardAnimFragment extends BaseFragment<FgCardAnimLayoutBinding> {
             assetName = "lottieHome/track_list.json";
         }
         mViewBinding.viewLiveAnim.setAnimation(assetName);
+        if(isCanPlay){
+            mViewBinding.viewLiveAnim.playAnimation();
+        }
     }
 
     public void startAnim(boolean isStart) {
+        this.isCanPlay = isStart;
         if(!isAdded()){
             return;
         }

+ 9 - 6
institution/src/main/res/layout/fg_card_anim_layout.xml

@@ -3,15 +3,18 @@
     xmlns:app="http://schemas.android.com/apk/res-auto"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
+    android:layout_gravity="center"
     xmlns:tools="http://schemas.android.com/tools">
 
     <com.airbnb.lottie.LottieAnimationView
         android:id="@+id/view_live_anim"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintRight_toRightOf="parent"
         app:layout_constraintTop_toTopOf="parent"
-        app:lottie_autoPlay="true"
+        app:lottie_autoPlay="false"
         app:lottie_loop="true" />
 
     <View
@@ -28,11 +31,11 @@
         android:layout_width="0dp"
         android:layout_height="0dp"
         android:background="@drawable/shape_66000000_12dp"
-        app:layout_constraintDimensionRatio="h,296:571"
-        app:layout_constraintBottom_toBottomOf="@+id/view_live_anim"
-        app:layout_constraintLeft_toLeftOf="@+id/view_live_anim"
-        app:layout_constraintRight_toRightOf="@+id/view_live_anim"
-        app:layout_constraintTop_toTopOf="@+id/view_live_anim" />
+        app:layout_constraintDimensionRatio="h,888:1712"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toTopOf="parent" />
 
     <ImageView
         android:id="@+id/iv_lock"

+ 1 - 2
institution/src/main/res/layout/fg_home_card_layout.xml

@@ -94,8 +94,6 @@
         android:layout_width="0dp"
         android:layout_height="0dp"
         app:layout_constraintWidth_percent="0.79"
-        android:layout_marginTop="16dp"
-        android:layout_marginBottom="16dp"
         android:clipChildren="false"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintLeft_toLeftOf="parent"
@@ -103,6 +101,7 @@
         app:layout_constraintTop_toBottomOf="@+id/view_search_bg">
 
         <androidx.viewpager2.widget.ViewPager2
+            android:layout_gravity="center"
             android:scrollbars="none"
             android:overScrollMode="never"
             android:clipChildren="false"