Pārlūkot izejas kodu

处理部分问题

Pq 8 mēneši atpakaļ
vecāks
revīzija
76bc465468

+ 11 - 3
teacher/src/main/java/com/cooleshow/teacher/adapter/MineLiveCourseAdapter.java

@@ -12,6 +12,7 @@ import com.chad.library.adapter.base.module.BaseLoadMoreModule;
 import com.chad.library.adapter.base.module.LoadMoreModule;
 import com.chad.library.adapter.base.viewholder.BaseViewHolder;
 import com.cooleshow.base.utils.GlideUtils;
+import com.cooleshow.base.utils.StringUtils;
 import com.cooleshow.base.utils.TimeUtils;
 import com.cooleshow.base.utils.UiUtils;
 import com.cooleshow.teacher.R;
@@ -43,12 +44,19 @@ public class MineLiveCourseAdapter extends BaseQuickAdapter<MineLiveCourseListBe
         String timeStr = TextUtils.isEmpty(item.courseStartTime) ? "" : TimeUtils.date2String(TimeUtils.string2Date(item.courseStartTime), "yyyy-MM-dd HH:mm");
         //时间
         helper.setText(R.id.tv_time, "开课时间:" + timeStr);
+        //title
+        helper.setText(R.id.tv_title, item.courseGroupName);
+        //介绍
+        String courseIntroduce = item.courseIntroduce;
+        if (TextUtils.isEmpty(courseIntroduce)) {
+            courseIntroduce = "暂无介绍";
+        }
+        courseIntroduce = StringUtils.replaceSpace(courseIntroduce);
+        helper.setText(R.id.tv_des, courseIntroduce);
         //课程封面
         ImageView iv_bg = helper.getView(R.id.iv_bg);
         GlideUtils.INSTANCE.loadImage(getContext(), item.backgroundPic, iv_bg);
-        //课程组名称
-        TextView tv_course_name = helper.getView(R.id.tv_course_name);
-        tv_course_name.setText(item.courseGroupName);
+
         //学生购买人数
         TextView tv_student_count = helper.getView(R.id.tv_buy_num);
         tv_student_count.setText(UiUtils.getBuyNumTip(item.coursePrice, item.studentCount));

+ 5 - 2
teacher/src/main/res/layout/fragment_mine_live_course.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     android:layout_width="match_parent"
     android:layout_height="match_parent">
@@ -7,6 +7,7 @@
 
     <com.scwang.smart.refresh.layout.SmartRefreshLayout
         android:id="@+id/refreshLayout"
+        android:layout_marginTop="12dp"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         app:layout_constraintLeft_toLeftOf="parent"
@@ -15,6 +16,8 @@
 
 
         <androidx.recyclerview.widget.RecyclerView
+            android:layout_marginStart="14dp"
+            android:layout_marginEnd="14dp"
             android:id="@+id/recyclerView"
             android:layout_width="match_parent"
             android:layout_height="match_parent"
@@ -71,4 +74,4 @@
             app:layout_constraintTop_toBottomOf="@+id/tv_empty_hint" />
     </androidx.constraintlayout.widget.ConstraintLayout>
 
-</androidx.constraintlayout.widget.ConstraintLayout>
+</FrameLayout>