Browse Source

小酷Ai进度条页面增加返回按钮逻辑

Pq 2 năm trước cách đây
mục cha
commit
0ab75a65f3

+ 10 - 0
student/src/main/java/com/cooleshow/student/ui/web/AccompanyFragment.java

@@ -201,6 +201,14 @@ public class AccompanyFragment extends BaseMVPFragment<FragmentAccompanyBinding,
     @Override
     protected void initData() {
         mShareListener = new CustomShareListener(getActivity());
+        mViewBinding.ivLoadingBack.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if (getActivity() != null) {
+                    getActivity().onBackPressed();
+                }
+            }
+        });
     }
 
 
@@ -384,11 +392,13 @@ public class AccompanyFragment extends BaseMVPFragment<FragmentAccompanyBinding,
     }
 
     private void showLoadingAnim() {
+        mViewBinding.ivLoadingBack.setVisibility(View.VISIBLE);
         mViewBinding.llLoading.setVisibility(View.VISIBLE);
         mViewBinding.viewLoadingAnim.playAnimation();
     }
 
     private void hideLoadingAnim() {
+        mViewBinding.ivLoadingBack.setVisibility(View.GONE);
         mViewBinding.viewLoadingAnim.clearAnimation();
         mViewBinding.llLoading.setVisibility(View.GONE);
     }

+ 10 - 0
student/src/main/res/layout/fragment_accompany.xml

@@ -41,4 +41,14 @@
             android:textColor="@color/white"
             android:textSize="@dimen/sp_18" />
     </LinearLayout>
+
+    <ImageView
+        android:id="@+id/iv_loading_back"
+        android:visibility="gone"
+        android:layout_marginTop="20dp"
+        android:layout_marginStart="20dp"
+        android:padding="14dp"
+        android:src="@drawable/icon_back_arrow_white"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"/>
 </FrameLayout>

+ 10 - 0
teacher/src/main/java/com/cooleshow/teacher/ui/web/AccompanyFragment.java

@@ -206,6 +206,14 @@ public class AccompanyFragment extends BaseMVPFragment<FragmentAccompanyBinding,
     @Override
     protected void initData() {
         mShareListener = new CustomShareListener(getActivity());
+        mViewBinding.ivLoadingBack.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if (getActivity() != null) {
+                    getActivity().onBackPressed();
+                }
+            }
+        });
     }
 
 
@@ -389,11 +397,13 @@ public class AccompanyFragment extends BaseMVPFragment<FragmentAccompanyBinding,
     }
 
     private void showLoadingAnim() {
+        mViewBinding.ivLoadingBack.setVisibility(View.VISIBLE);
         mViewBinding.llLoading.setVisibility(View.VISIBLE);
         mViewBinding.viewLoadingAnim.playAnimation();
     }
 
     private void hideLoadingAnim() {
+        mViewBinding.ivLoadingBack.setVisibility(View.GONE);
         mViewBinding.viewLoadingAnim.clearAnimation();
         mViewBinding.llLoading.setVisibility(View.GONE);
     }

+ 251 - 238
teacher/src/main/res/layout/activity_create_live.xml

@@ -9,253 +9,266 @@
         android:id="@+id/toolbar_include"
         layout="@layout/common_toolbar_layout" />
 
-    <androidx.constraintlayout.widget.ConstraintLayout
-        android:id="@+id/cl_title"
+    <ScrollView
         android:layout_width="match_parent"
-        android:layout_height="wrap_content"
+        android:layout_height="match_parent"
         android:layout_below="@+id/toolbar_include"
-        android:layout_marginStart="14dp"
-        android:layout_marginTop="15dp"
-        android:layout_marginEnd="14dp"
-        android:background="@drawable/bg_white_10dp">
+        android:overScrollMode="never"
+        android:scrollbars="none">
 
-
-        <TextView
-            android:id="@+id/tv_star_title"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginLeft="21dp"
-            android:layout_marginTop="20dp"
-            android:text="*"
-            android:textColor="@color/color_ff4e19"
-            android:textSize="@dimen/sp_17"
-            app:layout_constraintLeft_toLeftOf="parent"
-            app:layout_constraintTop_toTopOf="parent" />
-
-        <TextView
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="直播标题"
-            android:textColor="@color/black"
-            android:textSize="@dimen/sp_17"
-            android:textStyle="bold"
-            app:layout_constraintBottom_toBottomOf="@+id/tv_star_title"
-            app:layout_constraintLeft_toRightOf="@+id/tv_star_title"
-            app:layout_constraintTop_toTopOf="@+id/tv_star_title" />
-
-        <EditText
-            android:id="@+id/et_title"
+        <RelativeLayout
             android:layout_width="match_parent"
-            android:layout_height="@dimen/dp_45"
-            android:layout_marginLeft="21dp"
-            android:layout_marginRight="21dp"
-            android:background="@null"
-            android:gravity="left"
-            android:hint="请输入直播标题"
-            android:inputType="text"
-            android:paddingTop="8dp"
-            android:textColor="@color/black_333"
-            android:textColorHint="@color/color_ffc1c1c1"
-            android:textSize="16sp"
-            app:layout_constraintLeft_toLeftOf="parent"
-            app:layout_constraintTop_toBottomOf="@+id/tv_star_title" />
-
-
-    </androidx.constraintlayout.widget.ConstraintLayout>
-
-    <androidx.constraintlayout.widget.ConstraintLayout
-        android:id="@+id/cs_content"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_below="@+id/cl_title"
-        android:layout_marginStart="14dp"
-        android:layout_marginTop="15dp"
-        android:layout_marginEnd="14dp"
-        android:background="@drawable/bg_white_10dp"
-        android:paddingBottom="10dp">
-
-
-        <TextView
-            android:id="@+id/tv_star_content"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginLeft="21dp"
-            android:layout_marginTop="20dp"
-            android:text="*"
-            android:textColor="@color/color_ff4e19"
-            android:textSize="@dimen/sp_17"
-            app:layout_constraintLeft_toLeftOf="parent"
-            app:layout_constraintTop_toTopOf="parent" />
-
-        <TextView
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="直播内容"
-            android:textColor="@color/black"
-            android:textSize="@dimen/sp_17"
-            android:textStyle="bold"
-            app:layout_constraintBottom_toBottomOf="@+id/tv_star_content"
-            app:layout_constraintLeft_toRightOf="@+id/tv_star_content"
-            app:layout_constraintTop_toTopOf="@+id/tv_star_content" />
-
-
-        <EditText
-            android:id="@+id/et_content"
-            android:layout_width="match_parent"
-            android:layout_height="@dimen/dp_166"
-            android:layout_marginLeft="21dp"
-            android:layout_marginRight="21dp"
-            android:background="@null"
-            android:gravity="left"
-            android:hint="请输入直播内容"
-            android:inputType="text"
-            android:paddingTop="8dp"
-            android:textColor="@color/black_333"
-            android:textColorHint="@color/color_ffc1c1c1"
-            android:textSize="16sp"
-            app:layout_constraintLeft_toLeftOf="parent"
-            app:layout_constraintTop_toBottomOf="@+id/tv_star_content" />
-
-    </androidx.constraintlayout.widget.ConstraintLayout>
-
-    <androidx.constraintlayout.widget.ConstraintLayout
-        android:id="@+id/cs_live_duration"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_below="@+id/cs_content"
-        android:layout_marginStart="14dp"
-        android:layout_marginTop="15dp"
-        android:layout_marginEnd="14dp"
-        android:background="@drawable/bg_white_10dp"
-        android:paddingBottom="16dp">
-
-
-        <TextView
-            android:id="@+id/tv_star_title3"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginLeft="21dp"
-            android:layout_marginTop="20dp"
-            android:text="*"
-            android:textColor="@color/color_ff4e19"
-            android:textSize="@dimen/sp_17"
-            app:layout_constraintLeft_toLeftOf="parent"
-            app:layout_constraintTop_toTopOf="parent" />
-
-        <TextView
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="直播时长"
-            android:textColor="@color/black"
-            android:textSize="@dimen/sp_17"
-            android:textStyle="bold"
-            app:layout_constraintBottom_toBottomOf="@+id/tv_star_title3"
-            app:layout_constraintLeft_toRightOf="@+id/tv_star_title3"
-            app:layout_constraintTop_toTopOf="@+id/tv_star_title3" />
-
-        <TextView
-            android:id="@+id/tv_live_time"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginLeft="21dp"
-            android:layout_marginTop="8dp"
-            android:gravity="left"
-            android:text="请选择直播时长"
-            android:textColor="@color/color_ffc1c1c1"
-            android:textSize="16sp"
-            app:layout_constraintLeft_toLeftOf="parent"
-            app:layout_constraintTop_toBottomOf="@+id/tv_star_title3" />
-
-
-        <ImageView
-            android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_marginStart="7dp"
-            android:src="@drawable/icon_arrow_down"
-            app:layout_constraintBottom_toBottomOf="@+id/tv_live_time"
-            app:layout_constraintLeft_toRightOf="@+id/tv_live_time"
-            app:layout_constraintTop_toTopOf="@+id/tv_live_time" />
+            android:paddingBottom="100dp">
 
-    </androidx.constraintlayout.widget.ConstraintLayout>
-
-
-    <androidx.constraintlayout.widget.ConstraintLayout
-        android:id="@+id/cs_live_cover"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_below="@+id/cs_live_duration"
-        android:layout_marginStart="14dp"
-        android:layout_marginTop="15dp"
-        android:layout_marginEnd="14dp"
-        android:background="@drawable/bg_white_10dp"
-        android:paddingBottom="16dp">
-
-
-        <TextView
-            android:id="@+id/tv_star_title4"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginLeft="21dp"
-            android:layout_marginTop="20dp"
-            android:text="*"
-            android:textColor="@color/color_ff4e19"
-            android:textSize="@dimen/sp_17"
-            app:layout_constraintLeft_toLeftOf="parent"
-            app:layout_constraintTop_toTopOf="parent" />
-
-        <TextView
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="直播封面"
-            android:textColor="@color/black"
-            android:textSize="@dimen/sp_17"
-            android:textStyle="bold"
-            app:layout_constraintBottom_toBottomOf="@+id/tv_star_title4"
-            app:layout_constraintLeft_toRightOf="@+id/tv_star_title4"
-            app:layout_constraintTop_toTopOf="@+id/tv_star_title4" />
-
-        <androidx.constraintlayout.widget.Guideline
-            android:id="@+id/guide_center"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:orientation="vertical"
-            app:layout_constraintGuide_percent="0.5" />
-
-        <FrameLayout
-            android:id="@+id/fl_upload_cover"
-            android:layout_width="0dp"
-            android:layout_height="0dp"
-            android:layout_marginStart="14dp"
-            android:layout_marginTop="10dp"
-            app:layout_constraintDimensionRatio="16:9"
-            app:layout_constraintLeft_toLeftOf="parent"
-            app:layout_constraintRight_toLeftOf="@+id/guide_center"
-            app:layout_constraintTop_toBottomOf="@+id/tv_star_title4">
-
-            <View
+            <androidx.constraintlayout.widget.ConstraintLayout
+                android:id="@+id/cl_title"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="14dp"
+                android:layout_marginTop="15dp"
+                android:layout_marginEnd="14dp"
+                android:background="@drawable/bg_white_10dp">
+
+
+                <TextView
+                    android:id="@+id/tv_star_title"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="21dp"
+                    android:layout_marginTop="20dp"
+                    android:text="*"
+                    android:textColor="@color/color_ff4e19"
+                    android:textSize="@dimen/sp_17"
+                    app:layout_constraintLeft_toLeftOf="parent"
+                    app:layout_constraintTop_toTopOf="parent" />
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="直播标题"
+                    android:textColor="@color/black"
+                    android:textSize="@dimen/sp_17"
+                    android:textStyle="bold"
+                    app:layout_constraintBottom_toBottomOf="@+id/tv_star_title"
+                    app:layout_constraintLeft_toRightOf="@+id/tv_star_title"
+                    app:layout_constraintTop_toTopOf="@+id/tv_star_title" />
+
+                <EditText
+                    android:id="@+id/et_title"
+                    android:layout_width="match_parent"
+                    android:layout_height="@dimen/dp_45"
+                    android:layout_marginLeft="21dp"
+                    android:layout_marginRight="21dp"
+                    android:background="@null"
+                    android:gravity="left"
+                    android:hint="请输入直播标题"
+                    android:inputType="text"
+                    android:paddingTop="8dp"
+                    android:textColor="@color/black_333"
+                    android:textColorHint="@color/color_ffc1c1c1"
+                    android:textSize="16sp"
+                    app:layout_constraintLeft_toLeftOf="parent"
+                    app:layout_constraintTop_toBottomOf="@+id/tv_star_title" />
+
+
+            </androidx.constraintlayout.widget.ConstraintLayout>
+
+            <androidx.constraintlayout.widget.ConstraintLayout
+                android:id="@+id/cs_content"
                 android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:background="@drawable/bg_dash_border_e3e3e3_radius" />
-
-
-            <TextView
-                android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:layout_gravity="center"
-                android:drawableTop="@drawable/icon_upload_cover_tip"
-                android:drawablePadding="14dp"
-                android:includeFontPadding="false"
-                android:text="点击上传直播封面"
-                android:textColor="@color/color_999999"
-                android:textSize="@dimen/sp_14" />
-
-            <com.cooleshow.base.widgets.QMUIRadiusImageView
-                android:id="@+id/iv_cover"
+                android:layout_below="@+id/cl_title"
+                android:layout_marginStart="14dp"
+                android:layout_marginTop="15dp"
+                android:layout_marginEnd="14dp"
+                android:background="@drawable/bg_white_10dp"
+                android:paddingBottom="10dp">
+
+
+                <TextView
+                    android:id="@+id/tv_star_content"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="21dp"
+                    android:layout_marginTop="20dp"
+                    android:text="*"
+                    android:textColor="@color/color_ff4e19"
+                    android:textSize="@dimen/sp_17"
+                    app:layout_constraintLeft_toLeftOf="parent"
+                    app:layout_constraintTop_toTopOf="parent" />
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="直播内容"
+                    android:textColor="@color/black"
+                    android:textSize="@dimen/sp_17"
+                    android:textStyle="bold"
+                    app:layout_constraintBottom_toBottomOf="@+id/tv_star_content"
+                    app:layout_constraintLeft_toRightOf="@+id/tv_star_content"
+                    app:layout_constraintTop_toTopOf="@+id/tv_star_content" />
+
+
+                <EditText
+                    android:id="@+id/et_content"
+                    android:layout_width="match_parent"
+                    android:layout_height="@dimen/dp_166"
+                    android:layout_marginLeft="21dp"
+                    android:layout_marginRight="21dp"
+                    android:background="@null"
+                    android:gravity="left"
+                    android:hint="请输入直播内容"
+                    android:inputType="text"
+                    android:paddingTop="8dp"
+                    android:textColor="@color/black_333"
+                    android:textColorHint="@color/color_ffc1c1c1"
+                    android:textSize="16sp"
+                    app:layout_constraintLeft_toLeftOf="parent"
+                    app:layout_constraintTop_toBottomOf="@+id/tv_star_content" />
+
+            </androidx.constraintlayout.widget.ConstraintLayout>
+
+            <androidx.constraintlayout.widget.ConstraintLayout
+                android:id="@+id/cs_live_duration"
                 android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                app:qmui_corner_radius="10dp" />
-        </FrameLayout>
-    </androidx.constraintlayout.widget.ConstraintLayout>
+                android:layout_height="wrap_content"
+                android:layout_below="@+id/cs_content"
+                android:layout_marginStart="14dp"
+                android:layout_marginTop="15dp"
+                android:layout_marginEnd="14dp"
+                android:background="@drawable/bg_white_10dp"
+                android:paddingBottom="16dp">
+
+
+                <TextView
+                    android:id="@+id/tv_star_title3"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="21dp"
+                    android:layout_marginTop="20dp"
+                    android:text="*"
+                    android:textColor="@color/color_ff4e19"
+                    android:textSize="@dimen/sp_17"
+                    app:layout_constraintLeft_toLeftOf="parent"
+                    app:layout_constraintTop_toTopOf="parent" />
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="直播时长"
+                    android:textColor="@color/black"
+                    android:textSize="@dimen/sp_17"
+                    android:textStyle="bold"
+                    app:layout_constraintBottom_toBottomOf="@+id/tv_star_title3"
+                    app:layout_constraintLeft_toRightOf="@+id/tv_star_title3"
+                    app:layout_constraintTop_toTopOf="@+id/tv_star_title3" />
+
+                <TextView
+                    android:id="@+id/tv_live_time"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="21dp"
+                    android:layout_marginTop="8dp"
+                    android:gravity="left"
+                    android:text="请选择直播时长"
+                    android:textColor="@color/color_ffc1c1c1"
+                    android:textSize="16sp"
+                    app:layout_constraintLeft_toLeftOf="parent"
+                    app:layout_constraintTop_toBottomOf="@+id/tv_star_title3" />
+
+
+                <ImageView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginStart="7dp"
+                    android:src="@drawable/icon_arrow_down"
+                    app:layout_constraintBottom_toBottomOf="@+id/tv_live_time"
+                    app:layout_constraintLeft_toRightOf="@+id/tv_live_time"
+                    app:layout_constraintTop_toTopOf="@+id/tv_live_time" />
+
+            </androidx.constraintlayout.widget.ConstraintLayout>
+
+
+            <androidx.constraintlayout.widget.ConstraintLayout
+                android:id="@+id/cs_live_cover"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_below="@+id/cs_live_duration"
+                android:layout_marginStart="14dp"
+                android:layout_marginTop="15dp"
+                android:layout_marginEnd="14dp"
+                android:background="@drawable/bg_white_10dp"
+                android:paddingBottom="16dp">
+
+
+                <TextView
+                    android:id="@+id/tv_star_title4"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="21dp"
+                    android:layout_marginTop="20dp"
+                    android:text="*"
+                    android:textColor="@color/color_ff4e19"
+                    android:textSize="@dimen/sp_17"
+                    app:layout_constraintLeft_toLeftOf="parent"
+                    app:layout_constraintTop_toTopOf="parent" />
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="直播封面"
+                    android:textColor="@color/black"
+                    android:textSize="@dimen/sp_17"
+                    android:textStyle="bold"
+                    app:layout_constraintBottom_toBottomOf="@+id/tv_star_title4"
+                    app:layout_constraintLeft_toRightOf="@+id/tv_star_title4"
+                    app:layout_constraintTop_toTopOf="@+id/tv_star_title4" />
+
+                <androidx.constraintlayout.widget.Guideline
+                    android:id="@+id/guide_center"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:orientation="vertical"
+                    app:layout_constraintGuide_percent="0.5" />
+
+                <FrameLayout
+                    android:id="@+id/fl_upload_cover"
+                    android:layout_width="0dp"
+                    android:layout_height="0dp"
+                    android:layout_marginStart="14dp"
+                    android:layout_marginTop="10dp"
+                    app:layout_constraintDimensionRatio="16:9"
+                    app:layout_constraintLeft_toLeftOf="parent"
+                    app:layout_constraintRight_toLeftOf="@+id/guide_center"
+                    app:layout_constraintTop_toBottomOf="@+id/tv_star_title4">
+
+                    <View
+                        android:layout_width="match_parent"
+                        android:layout_height="match_parent"
+                        android:background="@drawable/bg_dash_border_e3e3e3_radius" />
+
+
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center"
+                        android:drawableTop="@drawable/icon_upload_cover_tip"
+                        android:drawablePadding="14dp"
+                        android:includeFontPadding="false"
+                        android:text="点击上传直播封面"
+                        android:textColor="@color/color_999999"
+                        android:textSize="@dimen/sp_14" />
+
+                    <com.cooleshow.base.widgets.QMUIRadiusImageView
+                        android:id="@+id/iv_cover"
+                        android:layout_width="match_parent"
+                        android:layout_height="match_parent"
+                        app:qmui_corner_radius="10dp" />
+                </FrameLayout>
+            </androidx.constraintlayout.widget.ConstraintLayout>
+        </RelativeLayout>
+    </ScrollView>
 
     <TextView
         android:id="@+id/tv_confirm"

+ 9 - 0
teacher/src/main/res/layout/fragment_accompany.xml

@@ -42,4 +42,13 @@
             android:textSize="@dimen/sp_18" />
     </LinearLayout>
 
+    <ImageView
+        android:id="@+id/iv_loading_back"
+        android:visibility="gone"
+        android:layout_marginTop="20dp"
+        android:layout_marginStart="20dp"
+        android:padding="14dp"
+        android:src="@drawable/icon_back_arrow_white"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"/>
 </FrameLayout>