Jelajahi Sumber

修改老师端我的视频课和我的直播课

Pq 3 tahun lalu
induk
melakukan
69a8e1d476

+ 13 - 0
BaseLibrary/src/main/java/com/cooleshow/base/utils/UiUtils.java

@@ -233,6 +233,19 @@ public class UiUtils {
         return price + "/" + lessonCount + "课时";
     }
 
+    public static String getVideoCoursePriceText2(String lessonPrice) {
+        String price = "¥" + lessonPrice;
+        try {
+            double v = Double.parseDouble(lessonPrice);
+            if (v == 0) {
+                price = Utils.getApp().getString(R.string.price_free_str);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return price;
+    }
+
     public static String getBuyNumTip(String lessonPrice, String buyCount) {
         try {
             double v = Double.parseDouble(lessonPrice);

+ 2 - 1
teacher/src/main/java/com/cooleshow/teacher/adapter/MineLiveCourseAdapter.java

@@ -81,7 +81,7 @@ public class MineLiveCourseAdapter extends BaseQuickAdapter<MineLiveCourseListBe
             tv_operate_tip.setVisibility(View.GONE);
         } else if (TextUtils.equals(type, MineLiveCourseActivity.TYPE_APPLY)) {
             //销售中
-            tv_course_status_tip.setText("未上架");
+            tv_course_status_tip.setText("销售中");
             tv_course_status_tip.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_ff1919));
             tv_course_status_tip.setBackgroundResource(R.drawable.shape_ffe7e7_15dp_left);
             tv_operate_tip.setVisibility(View.VISIBLE);
@@ -105,6 +105,7 @@ public class MineLiveCourseAdapter extends BaseQuickAdapter<MineLiveCourseListBe
             tv_course_status_tip.setBackgroundResource(R.drawable.shape_f0f0f0_15dp_left);
             tv_operate_tip.setVisibility(View.VISIBLE);
             tv_operate_tip.setText("重新上架");
+            tv_operate_tip.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_ff1919));
             tv_operate_tip.setCompoundDrawablesWithIntrinsicBounds(null, null, getContext().getResources().getDrawable(com.cooleshow.base.R.drawable.icon_arrow_right_small_red), null);
         }
     }

+ 58 - 13
teacher/src/main/java/com/cooleshow/teacher/adapter/MineVideoCourseAdapter.java

@@ -17,6 +17,7 @@ import com.cooleshow.teacher.R;
 import com.cooleshow.teacher.bean.MineLiveCourseListBean;
 import com.cooleshow.teacher.bean.MineVideoCourseListBean;
 import com.cooleshow.teacher.bean.VideoCourseListBean;
+import com.cooleshow.teacher.ui.course.MineVideoCourseActivity;
 
 import java.util.List;
 
@@ -27,9 +28,11 @@ import java.util.List;
  * 类说明:
  */
 public class MineVideoCourseAdapter extends BaseQuickAdapter<VideoCourseListBean.RowsBean, BaseViewHolder> implements LoadMoreModule {
+    private String auditStatus;
 
-    public MineVideoCourseAdapter() {
+    public MineVideoCourseAdapter(String auditStatus) {
         super(R.layout.layout_mine_video_course_item);
+        this.auditStatus = auditStatus;
     }
 
 
@@ -38,27 +41,69 @@ public class MineVideoCourseAdapter extends BaseQuickAdapter<VideoCourseListBean
         if (item == null) {
             return;
         }
+        //声部名称
         helper.setText(R.id.course_name, item.lessonSubjectName);
+        //封面
         ImageView im_pic = helper.getView(R.id.im_pic);
-        GlideUtils.INSTANCE.loadImage(getContext(), item.lessonCoverUrl, im_pic);
+        GlideUtils.INSTANCE.loadTopRoundImage(getContext(), item.lessonCoverUrl, im_pic, 10, com.cooleshow.base.R.drawable.bg_video_placeholder);
+        //课程名称
         TextView tv_title = helper.getView(R.id.tv_title);
         tv_title.setText(item.lessonName);
-        ImageView im_header = helper.getView(R.id.im_header);
-        GlideUtils.INSTANCE.loadImage(getContext(), item.avatar, im_header);
-        TextView tv_teacher_name = helper.getView(R.id.tv_teacher_name);
-        tv_teacher_name.setText(item.username);
+        //价格
         TextView tv_price = helper.getView(R.id.tv_price);
-        tv_price.setText(UiUtils.getVideoCoursePriceText(item.lessonPrice, item.lessonCount));
+        tv_price.setText(UiUtils.getVideoCoursePriceText2(item.lessonPrice));
+        TextView tv_price_unit = helper.getView(R.id.tv_price_unit);
+        tv_price_unit.setText(String.format("/%d课时", item.lessonCount));
+        //购买人数
         TextView tv_buy_num = helper.getView(R.id.tv_buy_num);
-        if (TextUtils.equals(item.auditStatus, "PASS")) {
-            tv_buy_num.setText(UiUtils.getBuyNumTip(item.lessonPrice, item.countStudent));
-            tv_buy_num.setVisibility(View.VISIBLE);
-            helper.setVisible(R.id.view_line2, true);
-        } else {
-            helper.setVisible(R.id.view_line2, false);
+        tv_buy_num.setText(UiUtils.getBuyNumTip(item.lessonPrice, item.countStudent));
+        if (TextUtils.equals(auditStatus, MineVideoCourseActivity.TYPE_DOING)) {
             tv_buy_num.setVisibility(View.GONE);
+        } else {
+            tv_buy_num.setVisibility(View.VISIBLE);
         }
 
+        TextView tv_operate_tip = helper.getView(R.id.tv_operate_tip);
+        View view_divide_bottom = helper.getView(R.id.view_divide_bottom);
+        TextView tv_course_status_tip = helper.getView(R.id.tv_course_status_tip);
+        if (TextUtils.equals(auditStatus, MineVideoCourseActivity.TYPE_PASS)) {
+            //已上架
+            tv_operate_tip.setVisibility(View.VISIBLE);
+            tv_operate_tip.setText("下架此课程");
+            tv_operate_tip.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_008ae0));
+            tv_operate_tip.setCompoundDrawablesWithIntrinsicBounds(null, null, getContext().getResources().getDrawable(com.cooleshow.base.R.drawable.icon_arrow_right_small_blue), null);
+            view_divide_bottom.setVisibility(View.VISIBLE);
+            tv_course_status_tip.setText("已上架");
+            tv_course_status_tip.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_2dc7aa));
+            tv_course_status_tip.setBackgroundResource(R.drawable.shape_d5fff7_9dp_right);
+        } else if (TextUtils.equals(auditStatus, MineVideoCourseActivity.TYPE_DOING)) {
+            //审核中
+            tv_operate_tip.setVisibility(View.GONE);
+            view_divide_bottom.setVisibility(View.INVISIBLE);
+            tv_course_status_tip.setText("审核中");
+            tv_course_status_tip.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_008ae0));
+            tv_course_status_tip.setBackgroundResource(R.drawable.shape_def2ff_9dp_right);
+        } else if (TextUtils.equals(auditStatus, MineVideoCourseActivity.TYPE_UNPASS)) {
+            //审核失败
+            tv_operate_tip.setVisibility(View.VISIBLE);
+            tv_operate_tip.setText("重新编辑");
+            tv_operate_tip.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_ff4e19));
+            tv_operate_tip.setCompoundDrawablesWithIntrinsicBounds(null, null, getContext().getResources().getDrawable(com.cooleshow.base.R.drawable.icon_arrow_right_small_orange), null);
+            view_divide_bottom.setVisibility(View.VISIBLE);
+            tv_course_status_tip.setText("失败");
+            tv_course_status_tip.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_ff1919));
+            tv_course_status_tip.setBackgroundResource(R.drawable.shape_ffe7e7_9dp_right);
+        } else if (TextUtils.equals(auditStatus, MineVideoCourseActivity.TYPE_OUT_SALE)) {
+            //已下架
+            tv_operate_tip.setVisibility(View.VISIBLE);
+            tv_operate_tip.setText("重新上架");
+            tv_operate_tip.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_ff1919));
+            tv_operate_tip.setCompoundDrawablesWithIntrinsicBounds(null, null, getContext().getResources().getDrawable(com.cooleshow.base.R.drawable.icon_arrow_right_small_red), null);
+            view_divide_bottom.setVisibility(View.VISIBLE);
+            tv_course_status_tip.setText("已下架");
+            tv_course_status_tip.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_666666));
+            tv_course_status_tip.setBackgroundResource(R.drawable.shape_f0f0f0_9dp_right);
+        }
     }
 
     @NonNull

+ 17 - 0
teacher/src/main/java/com/cooleshow/teacher/ui/course/MineLiveCourseActivity.java

@@ -1,7 +1,10 @@
 package com.cooleshow.teacher.ui.course;
 
+import android.graphics.Typeface;
 import android.os.Bundle;
+import android.util.Log;
 import android.view.View;
+import android.widget.TextView;
 
 import androidx.annotation.Nullable;
 import androidx.fragment.app.Fragment;
@@ -101,6 +104,20 @@ public class MineLiveCourseActivity extends BaseMVPActivity<ActivityMineLiveCour
         viewPager.setAdapter(new MineLiveCoursePagerAdapter(getSupportFragmentManager(), fragments, titles));
         viewPager.setOffscreenPageLimit(fragments.size());
         tabLayout.setupWithViewPager(viewPager);
+        tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
+            @Override
+            public void onTabSelected(TabLayout.Tab tab) {
+            }
+
+            @Override
+            public void onTabUnselected(TabLayout.Tab tab) {
+            }
+
+            @Override
+            public void onTabReselected(TabLayout.Tab tab) {
+
+            }
+        });
     }
 
 

+ 8 - 5
teacher/src/main/java/com/cooleshow/teacher/ui/course/MineVideoCourseActivity.java

@@ -37,6 +37,13 @@ import io.rong.imkit.utils.StatusBarUtil;
 @Route(path = RouterPath.CourseCenter.TEACHER_MINE_VIDEO_COURSE)
 public class MineVideoCourseActivity extends BaseMVPActivity<ActivityMineVideoCourseBinding, MineVideoCoursePresenter> implements View.OnClickListener {
     private boolean teacherIsCert;
+    private List<String> titles = new ArrayList<String>(Arrays.asList("已上架", "审核中", "审核失败", "已下架"));
+    private List<String> auditStatusList = new ArrayList<String>(Arrays.asList(TYPE_PASS, TYPE_DOING, TYPE_UNPASS, TYPE_OUT_SALE));
+    private List<Fragment> fragments = new ArrayList<>();
+    public static final String TYPE_PASS = "PASS";//已上架
+    public static final String TYPE_DOING = "DOING";//审核中
+    public static final String TYPE_UNPASS = "UNPASS";//审核失败
+    public static final String TYPE_OUT_SALE = "OUT_SALE";//已下架
 
     @Override
     public void onClick(View view) {
@@ -67,7 +74,7 @@ public class MineVideoCourseActivity extends BaseMVPActivity<ActivityMineVideoCo
 
     @Override
     protected void initView() {
-        initMidTitleToolBar(viewBinding.toolbarInclude.toolbar, "视频课");
+        initMidTitleToolBar(viewBinding.toolbarInclude.toolbar, "我的视频课");
         viewBinding.toolbarInclude.tvRightText.setTextColor(getResources().getColor(com.cooleshow.base.R.color.common_black));
         viewBinding.toolbarInclude.tvRightText.setVisibility(View.VISIBLE);
         viewBinding.toolbarInclude.tvRightText.setText("创建课程");
@@ -84,10 +91,6 @@ public class MineVideoCourseActivity extends BaseMVPActivity<ActivityMineVideoCo
     }
 
 
-    private List<String> titles = new ArrayList<String>(Arrays.asList("已上架", "审核中", "审核失败", "已下架"));
-    private List<String> auditStatusList = new ArrayList<String>(Arrays.asList("PASS", "DOING", "UNPASS", "OUT_SALE"));
-    private List<Fragment> fragments = new ArrayList<>();
-
     private void initTabLayoutAndViewPager() {
         tabLayout.removeAllTabs();
         fragments.clear();

+ 1 - 1
teacher/src/main/java/com/cooleshow/teacher/ui/course/MineVideoCourseFragment.java

@@ -90,7 +90,7 @@ public class MineVideoCourseFragment extends BaseMVPFragment<FragmentMineVideoCo
         RecyclerView rvAddress = mViewBinding.recyclerView;
         LinearLayoutManager manager = new GridLayoutManager(getContext(), 2);
         rvAddress.setLayoutManager(manager);
-        mineVideoCourseAdapter = new MineVideoCourseAdapter();
+        mineVideoCourseAdapter = new MineVideoCourseAdapter(auditStatus);
         LayoutInflater inflater = LayoutInflater.from(getContext());
         View emptyLayout = inflater.inflate(R.layout.empty_mine_video_course, null);
         TextView tv_create = emptyLayout.findViewById(R.id.tv_create);

+ 1 - 1
teacher/src/main/java/com/cooleshow/teacher/ui/homepage/VideoCoursePageFragment.java

@@ -45,7 +45,7 @@ public class VideoCoursePageFragment extends BaseMVPFragment<FragmentVideoCourse
         RecyclerView rvAddress = mViewBinding.recyclerView;
         GridLayoutManager manager = new GridLayoutManager(getContext(), 2);
         rvAddress.setLayoutManager(manager);
-        mineVideoCourseAdapter = new MineVideoCourseAdapter();
+        mineVideoCourseAdapter = new MineVideoCourseAdapter("");
         EmptyViewLayout mEmptyView = new EmptyViewLayout(getContext());
         mEmptyView.setContent(com.cooleshow.base.R.drawable.icon_empty_course, "暂无课程~");
         mineVideoCourseAdapter.setEmptyView(mEmptyView);

+ 6 - 0
teacher/src/main/res/drawable/shape_d5fff7_9dp_right.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="@color/color_d5fff7"/>
+    <corners android:topRightRadius="8.5dp"
+        android:bottomRightRadius="8.5dp"/>
+</shape>

+ 6 - 0
teacher/src/main/res/drawable/shape_def2ff_9dp_right.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="@color/color_def2ff"/>
+    <corners android:topRightRadius="8.5dp"
+        android:bottomRightRadius="8.5dp"/>
+</shape>

+ 6 - 0
teacher/src/main/res/drawable/shape_f0f0f0_9dp_right.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="@color/color_f0f0f0"/>
+    <corners android:topRightRadius="8.5dp"
+        android:bottomRightRadius="8.5dp"/>
+</shape>

+ 6 - 0
teacher/src/main/res/drawable/shape_ffe7e7_9dp_right.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="@color/color_ffe7e7"/>
+    <corners android:topRightRadius="8.5dp"
+        android:bottomRightRadius="8.5dp"/>
+</shape>

+ 20 - 6
teacher/src/main/res/layout/activity_mine_live_course.xml

@@ -1,34 +1,48 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<androidx.constraintlayout.widget.ConstraintLayout 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"
-    android:background="@color/color_f6f8f9"
     android:orientation="vertical">
 
     <include
         android:id="@+id/toolbar_include"
         layout="@layout/common_toolbar_layout" />
 
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="0dp"
+        android:background="@color/white"
+        app:layout_constraintBottom_toBottomOf="@+id/tablayout"
+        app:layout_constraintTop_toBottomOf="@+id/toolbar_include" />
+
     <com.google.android.material.tabs.TabLayout
         android:id="@+id/tablayout"
         android:layout_width="match_parent"
         android:layout_height="@dimen/dp_44"
         android:scrollbars="none"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/toolbar_include"
         app:tabBackground="@null"
         app:tabGravity="fill"
         app:tabIndicator="@drawable/tab_indicator"
         app:tabIndicatorColor="@color/color_2dc7aa"
         app:tabIndicatorFullWidth="false"
         app:tabIndicatorHeight="4dp"
-        app:tabMode="fixed"
+        app:tabMode="scrollable"
         app:tabRippleColor="@null"
         app:tabSelectedTextColor="@color/black_333"
-        app:tabTextAppearance="@style/tab_layout_style"
+        app:tabTextAppearance="@style/tab_layout_style_17sp"
         app:tabTextColor="@color/color_666666" />
+
     <androidx.viewpager.widget.ViewPager
         android:id="@+id/viewpager"
         android:layout_width="match_parent"
         android:layout_height="0dp"
-        android:layout_weight="1" />
-</LinearLayout>
+        android:layout_weight="1"
+        android:overScrollMode="never"
+        android:scrollbars="none"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/tablayout" />
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 19 - 5
teacher/src/main/res/layout/activity_mine_video_course.xml

@@ -1,20 +1,29 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     android:layout_width="match_parent"
-    android:background="@color/color_f6f8f9"
     android:layout_height="match_parent"
+    android:background="@color/color_f6f8f9"
     android:orientation="vertical">
 
     <include
         android:id="@+id/toolbar_include"
         layout="@layout/common_toolbar_layout" />
 
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="0dp"
+        android:background="@color/white"
+        app:layout_constraintBottom_toBottomOf="@+id/tablayout"
+        app:layout_constraintTop_toBottomOf="@+id/toolbar_include" />
+
     <com.google.android.material.tabs.TabLayout
         android:id="@+id/tablayout"
         android:layout_width="match_parent"
         android:layout_height="@dimen/dp_44"
         android:scrollbars="none"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/toolbar_include"
         app:tabBackground="@null"
         app:tabGravity="fill"
         app:tabIndicator="@drawable/tab_indicator"
@@ -22,14 +31,19 @@
         app:tabIndicatorFullWidth="false"
         app:tabIndicatorHeight="4dp"
         app:tabMode="fixed"
+        app:tabPaddingEnd="0dp"
+        app:tabPaddingStart="0dp"
         app:tabRippleColor="@null"
         app:tabSelectedTextColor="@color/black_333"
-        app:tabTextAppearance="@style/tab_layout_style"
+        app:tabTextAppearance="@style/tab_layout_style_17sp"
         app:tabTextColor="@color/color_666666" />
 
     <androidx.viewpager.widget.ViewPager
         android:id="@+id/viewpager"
         android:layout_width="match_parent"
         android:layout_height="0dp"
-        android:layout_weight="1" />
-</LinearLayout>
+        android:layout_weight="1"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/tablayout" />
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 1 - 0
teacher/src/main/res/layout/layout_mine_live_course_item.xml

@@ -10,6 +10,7 @@
     android:background="@drawable/bg_white_10dp">
 
     <TextView
+        android:textStyle="bold"
         android:id="@+id/tv_status_title"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"

+ 127 - 107
teacher/src/main/res/layout/layout_mine_video_course_item.xml

@@ -1,123 +1,143 @@
 <?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
-    android:layout_height="wrap_content">
+    android:layout_height="wrap_content"
+    android:layout_marginLeft="6dp"
+    android:layout_marginTop="12dp"
+    android:layout_marginRight="6dp"
+    android:background="@drawable/bg_white_10dp">
 
-    <androidx.constraintlayout.widget.ConstraintLayout
+
+    <ImageView
+        android:id="@+id/im_pic"
         android:layout_width="match_parent"
+        android:layout_height="@dimen/dp_95"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
+        app:qmui_corner_radius="5dp" />
+
+    <TextView
+        android:id="@+id/tv_course_status_tip"
+        android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_marginLeft="6dp"
-        android:layout_marginTop="12dp"
-        android:layout_marginRight="6dp"
-        android:background="@drawable/bg_white_5dp">
+        android:layout_marginTop="9dp"
+        android:background="@drawable/shape_d5fff7_9dp_right"
+        android:gravity="center"
+        android:paddingStart="4dp"
+        android:paddingTop="2dp"
+        android:paddingEnd="7dp"
+        android:paddingBottom="2dp"
+        android:text="已上架"
+        android:textColor="@color/color_2dc7aa"
+        android:textSize="@dimen/sp_10"
+        android:visibility="visible"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintTop_toTopOf="@+id/im_pic"
+        tools:visibility="visible" />
 
-        <com.cooleshow.base.widgets.QMUIRadiusImageView
-            android:id="@+id/im_pic"
-            android:layout_width="match_parent"
-            android:layout_height="@dimen/dp_111"
-            app:layout_constraintLeft_toLeftOf="parent"
-            app:layout_constraintTop_toTopOf="parent"
-            app:qmui_corner_radius="5dp" />
+    <TextView
+        android:id="@+id/course_name"
+        android:layout_width="wrap_content"
+        android:layout_height="@dimen/dp_13"
+        android:layout_marginEnd="@dimen/dp_5"
+        android:layout_marginBottom="@dimen/dp_7"
+        android:background="@drawable/gray_1_radius_bg"
+        android:gravity="center"
+        android:paddingLeft="@dimen/dp_4"
+        android:paddingRight="@dimen/dp_4"
+        android:textColor="@color/white"
+        android:textSize="@dimen/sp_9"
+        app:layout_constraintBottom_toBottomOf="@+id/im_pic"
+        app:layout_constraintRight_toRightOf="@+id/im_pic" />
 
-        <TextView
-            android:id="@+id/course_name"
-            android:layout_width="wrap_content"
-            android:layout_height="@dimen/dp_13"
-            android:layout_marginLeft="@dimen/dp_5"
-            android:layout_marginTop="@dimen/dp_7"
-            android:background="@drawable/gray_1_radius_bg"
-            android:gravity="center"
-            android:paddingLeft="@dimen/dp_4"
-            android:paddingRight="@dimen/dp_4"
-            android:textColor="@color/white"
-            android:textSize="@dimen/sp_9"
-            app:layout_constraintLeft_toLeftOf="@+id/im_pic"
-            app:layout_constraintTop_toTopOf="@+id/im_pic" />
+    <TextView
+        android:lines="2"
+        android:id="@+id/tv_title"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="11dp"
+        android:layout_marginTop="5dp"
+        android:layout_marginEnd="11dp"
+        android:ellipsize="end"
+        android:includeFontPadding="false"
+        android:maxLines="2"
+        android:text="从零开始学竖笛视频课"
+        android:textColor="@color/color_1a1a1a"
+        android:textSize="@dimen/sp_14"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/im_pic" />
 
-        <TextView
-            android:id="@+id/tv_title"
-            android:layout_width="0dp"
-            android:layout_height="wrap_content"
-            android:layout_marginLeft="11dp"
-            android:layout_marginTop="5dp"
-            android:layout_marginEnd="11dp"
-            android:includeFontPadding="false"
-            android:lines="1"
-            android:text="从零开始学竖笛视频课"
-            android:textColor="@color/color_1a1a1a"
-            android:textSize="@dimen/sp_14"
-            app:layout_constraintLeft_toLeftOf="parent"
-            app:layout_constraintRight_toRightOf="parent"
-            app:layout_constraintTop_toBottomOf="@+id/im_pic" />
 
-        <de.hdodenhof.circleimageview.CircleImageView
-            android:id="@+id/im_header"
-            android:layout_width="18dp"
-            android:layout_height="18dp"
-            android:layout_marginLeft="11dp"
-            android:layout_marginTop="9dp"
-            android:src="@drawable/icon_teacher_default_head"
-            app:layout_constraintLeft_toLeftOf="parent"
-            app:layout_constraintTop_toBottomOf="@+id/tv_title" />
+    <TextView
+        android:id="@+id/tv_price"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="11dp"
+        android:layout_marginTop="6dp"
+        android:text="¥120"
+        android:textColor="@color/color_ff0000"
+        android:textSize="@dimen/sp_14"
+        android:textStyle="bold"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/tv_title" />
 
+    <TextView
+        android:id="@+id/tv_price_unit"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginRight="11dp"
+        android:paddingStart="7dp"
+        android:text="/4课时"
+        android:textColor="@color/color_999999"
+        android:textSize="@dimen/sp_14"
+        app:layout_constraintBaseline_toBaselineOf="@+id/tv_price"
+        app:layout_constraintLeft_toRightOf="@+id/tv_price" />
 
-        <TextView
-            android:id="@+id/tv_teacher_name"
-            android:layout_width="0dp"
-            android:layout_height="wrap_content"
-            android:layout_marginLeft="6dp"
-            android:ellipsize="end"
-            android:maxLines="1"
-            android:textColor="@color/color_999999"
-            android:textSize="@dimen/sp_12"
-            app:layout_constraintBottom_toBottomOf="@+id/im_header"
-            app:layout_constraintLeft_toRightOf="@+id/im_header"
-            app:layout_constraintRight_toLeftOf="@+id/view_line2"
-            app:layout_constraintTop_toTopOf="@+id/im_header"
-            tools:text="李老师李老师李老师李老师李老师李老师李老师李老师李老师李老师" />
+    <TextView
+        android:id="@+id/tv_buy_num"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="11dp"
+        android:layout_marginTop="5dp"
+        android:includeFontPadding="false"
+        android:text="0人已购买"
+        android:textColor="@color/color_ff802c"
+        android:textSize="@dimen/sp_11"
+        android:visibility="visible"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/tv_price"
+        tools:text="6人已购买" />
 
-        <View
-            android:id="@+id/view_line2"
-            android:layout_width="1dp"
-            android:layout_height="11dp"
-            android:layout_marginStart="6dp"
-            android:background="@color/color_d3d3d3"
-            android:visibility="visible"
-            app:layout_constraintBottom_toBottomOf="@+id/tv_teacher_name"
-            app:layout_constraintLeft_toRightOf="@+id/tv_teacher_name"
-            app:layout_constraintRight_toLeftOf="@+id/tv_buy_num"
-            app:layout_constraintTop_toTopOf="@+id/tv_teacher_name" />
+    <View
+        android:id="@+id/view_divide_bottom"
+        android:layout_width="match_parent"
+        android:layout_height="1dp"
+        android:layout_marginTop="9dp"
+        android:background="@color/color_F8F8F8"
+        android:visibility="invisible"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/tv_buy_num"
+        tools:visibility="visible" />
 
-        <TextView
-            android:id="@+id/tv_buy_num"
-            android:layout_width="0dp"
-            android:layout_height="wrap_content"
-            android:layout_marginStart="6dp"
-            android:includeFontPadding="false"
-            android:text="0人已购买"
-            android:textColor="@color/color_ff802c"
-            android:textSize="@dimen/sp_11"
-            android:visibility="visible"
-            app:layout_constraintBottom_toBottomOf="@+id/view_line2"
-            app:layout_constraintLeft_toRightOf="@+id/view_line2"
-            app:layout_constraintRight_toRightOf="parent"
-            app:layout_constraintTop_toTopOf="@+id/view_line2"
-            tools:text="6人已购买" />
+    <TextView
+        android:id="@+id/tv_operate_tip"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="10dp"
+        android:layout_marginBottom="10dp"
+        android:drawableRight="@drawable/icon_arrow_right_small_blue"
+        android:drawablePadding="5dp"
+        android:text="下架此课程"
+        android:textColor="@color/color_008ae0"
+        android:textSize="@dimen/sp_14"
+        android:visibility="gone"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/view_divide_bottom"
+        tools:visibility="visible" />
 
-        <TextView
-            android:id="@+id/tv_price"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginLeft="11dp"
-            android:layout_marginTop="2dp"
-            android:layout_marginBottom="12dp"
-            android:text="¥120/4课时"
-            android:textColor="@color/color_2dc7aa"
-            android:textSize="@dimen/sp_14"
-            app:layout_constraintBottom_toBottomOf="parent"
-            app:layout_constraintLeft_toLeftOf="parent"
-            app:layout_constraintTop_toBottomOf="@+id/im_header" />
-    </androidx.constraintlayout.widget.ConstraintLayout>
-</RelativeLayout>
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 4 - 0
teacher/src/main/res/values/styles.xml

@@ -23,6 +23,10 @@
         <item name="textAllCaps">false</item>
         <item name="android:textSize">@dimen/sp_14</item>
     </style>
+    <style name="tab_layout_style_17sp" parent="TextAppearance.Design.Tab">
+        <item name="textAllCaps">false</item>
+        <item name="android:textSize">@dimen/sp_17</item>
+    </style>
     <!-- 自定义对话框. -->
     <style name="Dialog" mce_bogus="1" parent="Theme.AppCompat.Dialog">
         <item name="android:windowBackground">@color/transparent</item>