Преглед на файлове

Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	student/src/main/res/layout/fragment_home_layout.xml
邓琴文 преди 3 години
родител
ревизия
468237687c

+ 11 - 0
BaseLibrary/src/main/java/com/cooleshow/base/utils/Utils.java

@@ -178,6 +178,17 @@ public final class Utils {
         view.setLayoutParams(layoutParams);
     }
 
+    public static int getCurrentStatusBarHeight(Context context) {
+        int statusBarHeight = QMUIDisplayHelper.getStatusBarHeight(context);
+        if (statusBarHeight == 0) {
+            statusBarHeight = getStatusBarHeight(context);
+        }
+        if (statusBarHeight == 0) {
+            statusBarHeight = SizeUtils.dp2px(20);
+        }
+        return statusBarHeight;
+    }
+
 
     public static int getStatusBarHeight(Context context) {
         int result = 0;

+ 9 - 15
live_teaching/src/main/java/com/daya/live_teaching/ui/LiveActivity.java

@@ -32,6 +32,7 @@ import com.cooleshow.base.utils.KeyboardUtils;
 import com.cooleshow.base.utils.LogUtils;
 import com.cooleshow.base.utils.SizeUtils;
 import com.cooleshow.base.utils.ToastUtil;
+import com.cooleshow.base.utils.Utils;
 import com.daya.live_teaching.R;
 import com.daya.live_teaching.common.ShowToastObserver;
 import com.daya.live_teaching.databinding.ActivityLiveBinding;
@@ -140,7 +141,10 @@ public class LiveActivity extends BaseActivity<ActivityLiveBinding> {
 
     @Override
     protected void initView() {
-
+        int currentStatusBarHeight = Utils.getCurrentStatusBarHeight(this);
+        ConstraintLayout.LayoutParams params = (ConstraintLayout.LayoutParams) viewBinding.viewStatusVar.getLayoutParams();
+        params.width = currentStatusBarHeight;
+        viewBinding.viewStatusVar.setLayoutParams(params);
     }
 
     @Override
@@ -221,21 +225,11 @@ public class LiveActivity extends BaseActivity<ActivityLiveBinding> {
             public void run() {
                 if (!isScreenOriatationPortrait()) {
                     int height = shareScreenFragmentViewLayout.getMeasuredHeight();
+                    LogUtils.i("pq", "shareScreenFragmentViewLayout height:" + height);
                     ViewGroup.LayoutParams lp = shareScreenFragmentViewLayout.getLayoutParams();
-                    //                    int screenHeight = DensityUtil.getScreenHeight(getApplicationContext());
-                    //                    int screenWidth = DensityUtil.getScreenWidth(getApplicationContext());
-                    //                    if (screenWidth - screenHeight < DensityUtil.dp2px(getApplicationContext(), 160)) {
-                    //                        if (screenWidth - screenHeight > 0) {
-                    //                            height -= (DensityUtil.dp2px(getApplicationContext(), 160) - (screenWidth - screenHeight));
-                    //                        } else {
-                    //                            height = (screenWidth - DensityUtil.dp2px(getApplicationContext(), 160));
-                    //                        }
-                    //                        height = (int) (height / (4 / 3d));
-                    //                    }
-
                     if (height > 0) {
-                        lp.width = (int) (height * (4 / 3d) + SizeUtils.dp2px(15));
-                        //                        lp.height = height;
+                        lp.width = (int) (height * (4 / 3d));
+                        LogUtils.i("pq", "shareScreenFragmentViewLayout width:" + lp.width);
                         shareScreenFragmentViewLayout.setLayoutParams(lp);
                     }
                 }
@@ -1001,7 +995,7 @@ public class LiveActivity extends BaseActivity<ActivityLiveBinding> {
             if (deviceType == DeviceType.Microphone) {
                 showToast("老师开启了你的麦克风");
                 deviceApprove(roomId, ClassRepository.PARAM_MICROPHONE_TYPE);
-            }else{
+            } else {
                 deviceApprove(roomId, ClassRepository.PARAM_MUSIC_MODE_TYPE);
             }
             return;

+ 7 - 1
live_teaching/src/main/java/com/daya/live_teaching/ui/fragmnet/TeachingToolsFragment.java

@@ -237,6 +237,10 @@ public class TeachingToolsFragment extends BaseFragment<FragmentTeachingToolsBin
         int value = SizeUtils.dp2px(44);
         int marginLeft = SizeUtils.dp2px(10);
         for (Operate operate : Operate.values()) {
+            if (operate== Operate.ACCOMPANIMENT || operate== Operate.ACCOMPANIMENT_SETTING) {
+                //暂时隐藏伴奏和伴奏下载
+                continue;
+            }
             OperateItem item = new OperateItem();
             item.id = operate.getValue();
             item.bgResId = leftbBtnBgResIds[operate.getValue()];
@@ -414,7 +418,9 @@ public class TeachingToolsFragment extends BaseFragment<FragmentTeachingToolsBin
         }
         CheckBox accompaniment = operateView.getView(Operate.ACCOMPANIMENT.getValue());
         isPlayMusic = false;
-        accompaniment.setChecked(false);
+        if (accompaniment != null) {
+            accompaniment.setChecked(false);
+        }
         CheckBox metronome = operateView.getView(Operate.METRONOME.getValue());
         isPlayMetronme = false;
         metronome.setChecked(false);

+ 29 - 22
live_teaching/src/main/res/layout/activity_live.xml

@@ -13,6 +13,13 @@
     tools:ignore="MissingDefaultResource">
 
 
+    <View
+        android:id="@+id/view_status_var"
+        android:layout_width="1px"
+        android:layout_height="1px"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintTop_toTopOf="parent" />
+
     <FrameLayout
         android:id="@+id/share_screen_fragment"
         android:layout_width="@dimen/dp_200"
@@ -20,7 +27,7 @@
         android:layout_marginTop="@dimen/dp_5"
         android:layout_marginBottom="@dimen/dp_10"
         app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintLeft_toRightOf="@+id/view_status_var"
         app:layout_constraintTop_toTopOf="parent"
         app:layout_constraintVertical_bias="0.0" />
 
@@ -48,42 +55,42 @@
     <FrameLayout
         android:id="@+id/teaching_tools_fragment"
         android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
+        android:layout_height="97dp"
         android:layout_marginEnd="@dimen/dp_5"
         app:layout_constraintBottom_toBottomOf="@id/tv_teaching_tools"
-        app:layout_constraintTop_toTopOf="@id/tv_teaching_tools"
-        app:layout_constraintEnd_toStartOf="@id/tv_teaching_tools"/>
+        app:layout_constraintEnd_toStartOf="@id/tv_teaching_tools"
+        app:layout_constraintTop_toTopOf="@id/tv_teaching_tools" />
 
     <ImageView
         android:id="@+id/iv_activity_live_share_screen_location"
-        android:visibility="invisible"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_marginBottom="@dimen/dp_10"
+        android:src="@drawable/ic_student_on_stage"
+        android:visibility="invisible"
         app:layout_constraintBottom_toBottomOf="@id/share_screen_fragment"
-        app:layout_constraintEnd_toEndOf="@+id/share_screen_fragment"
-        android:src="@drawable/ic_student_on_stage"/>
+        app:layout_constraintEnd_toEndOf="@+id/share_screen_fragment" />
 
     <com.cooleshow.base.widgets.ColorTextView
         android:id="@+id/tv_teaching_tools"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:paddingLeft="@dimen/dp_3"
-        android:paddingRight="@dimen/dp_3"
-        android:paddingTop="@dimen/dp_5"
-        android:paddingBottom="@dimen/dp_5"
-        android:layout_marginBottom="@dimen/dp_15"
         android:layout_marginRight="@dimen/dp_5"
-        app:ctvBackground="#01C1B5"
-        app:ctvCornerSize="8dp"
+        android:layout_marginBottom="@dimen/dp_15"
         android:drawableStart="@drawable/ic_teacher_tools"
         android:gravity="center"
+        android:paddingLeft="@dimen/dp_3"
+        android:paddingTop="@dimen/dp_5"
+        android:paddingRight="@dimen/dp_3"
+        android:paddingBottom="@dimen/dp_5"
         android:text="教学工具"
-        android:visibility="gone"
         android:textColor="@color/white"
         android:textSize="@dimen/dp_12"
-        app:layout_constraintTop_toTopOf="@+id/iv_activity_live_share_screen_location"
-        app:layout_constraintEnd_toEndOf="@+id/share_screen_fragment" />
+        android:visibility="gone"
+        app:ctvBackground="#01C1B5"
+        app:ctvCornerSize="8dp"
+        app:layout_constraintRight_toLeftOf="@+id/video_list_fragment"
+        app:layout_constraintTop_toTopOf="@+id/iv_activity_live_share_screen_location" />
 
 
     <TextView
@@ -130,7 +137,10 @@
         android:id="@+id/video_list_fragment"
         android:layout_width="0dp"
         android:layout_height="0dp"
+        android:layout_marginStart="15dp"
         android:layout_marginTop="@dimen/dp_5"
+        android:layout_marginEnd="15dp"
+        android:layout_marginBottom="5dp"
         app:layout_constraintBottom_toTopOf="@id/play_metronome_fragment"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toEndOf="@+id/share_screen_fragment"
@@ -139,14 +149,11 @@
     <FrameLayout
         android:id="@+id/play_metronome_fragment"
         android:layout_width="0dp"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="@dimen/dp_5"
+        android:layout_height="@dimen/dp_74"
         android:visibility="gone"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toEndOf="@+id/share_screen_fragment"
-        app:layout_constraintTop_toBottomOf="@id/video_list_fragment" />
-
+        app:layout_constraintStart_toEndOf="@+id/share_screen_fragment" />
 
     <FrameLayout
         android:id="@+id/top_operate_control_fragment"

+ 2 - 2
live_teaching/src/main/res/layout/fragment_teaching_tools.xml

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="utf-8"?>
 <com.daya.live_teaching.widget.OperateButtonGroupView xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@+id/operate_view"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
     android:background="@drawable/bg_live_teacher_tool"
     android:paddingStart="@dimen/dp_15"
     android:paddingTop="@dimen/dp_7"

+ 1 - 1
student/src/main/java/com/cooleshow/student/bean/SparringCourseHomeworkBean.java

@@ -37,7 +37,7 @@ public class SparringCourseHomeworkBean {
     public String classDate;
     public String content;
     public int courseGroupId;
-    public int courseScheduleId;
+    public String courseScheduleId;
     public String courseStatus;
     public String courseType;
     public int decorateHomework;

+ 4 - 4
student/src/main/res/layout/fragment_home_layout.xml

@@ -9,8 +9,8 @@
 
     <androidx.constraintlayout.widget.ConstraintLayout
         android:layout_width="match_parent"
-        android:background="@color/white"
-        android:layout_height="@dimen/dp_80">
+        android:layout_height="@dimen/dp_80"
+        android:background="@color/white">
 
         <de.hdodenhof.circleimageview.CircleImageView
             android:id="@+id/iv_avatar"
@@ -28,12 +28,12 @@
             android:layout_height="wrap_content"
             android:layout_marginLeft="@dimen/dp_10"
             android:text="--"
-            tools:text="aaaa"
             android:textColor="@color/color_333333"
             android:textSize="@dimen/sp_18"
             app:layout_constraintBottom_toBottomOf="@+id/iv_avatar"
             app:layout_constraintLeft_toRightOf="@+id/iv_avatar"
-            app:layout_constraintTop_toTopOf="@+id/iv_avatar" />
+            app:layout_constraintTop_toTopOf="@+id/iv_avatar"
+            tools:text="aaaa" />
 
         <ImageView
             android:id="@+id/im_message"