Browse Source

修改老师端个人主页视频课程样式

Pq 3 months ago
parent
commit
fd876ccdbe

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

@@ -276,7 +276,7 @@ public class UiUtils {
     }
 
     public static String getVideoCoursePriceText2(String lessonPrice) {
-        String price = "¥" + lessonPrice;
+        String price = lessonPrice;
         try {
             double v = Double.parseDouble(lessonPrice);
             if (v == 0) {

+ 5 - 0
BaseLibrary/src/main/res/drawable/shape_f5f6fa_3dp.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="#f5f6fa"/>
+    <corners android:radius="3dp"/>
+</shape>

+ 4 - 0
student/src/main/java/com/cooleshow/student/adapter/VideoCourseListAdapter.java

@@ -44,16 +44,20 @@ public class VideoCourseListAdapter extends BaseQuickAdapter<SelectMyGroupBean.R
 
         //¥120/4课时
         TextView tv_price = holder.getView(R.id.tv_price);
+        TextView tv_price_symbol = holder.getView(R.id.tv_price_symbol);
         boolean isVipType = TextUtils.equals(data.payType, VideoCoursePayType.VIP.getId());
         if (isVipType) {
             tv_price.setText("会员");
+            tv_price_symbol.setVisibility(View.GONE);
             tv_price.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_c76e21));
         } else {
             //收费
             tv_price.setText(UiUtils.getVideoCoursePriceText2(data.lessonPrice));
             if (UiUtils.isFree(data.lessonPrice)) {
+                tv_price_symbol.setVisibility(View.GONE);
                 tv_price.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_20bea0));
             } else {
+                tv_price_symbol.setVisibility(View.VISIBLE);
                 tv_price.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_ff0000));
             }
         }

+ 11 - 1
student/src/main/res/layout/item_video_course_list_layout.xml

@@ -125,8 +125,18 @@
         android:textStyle="bold"
         app:layout_constraintLeft_toLeftOf="@+id/cir_avatar"
         app:layout_constraintTop_toBottomOf="@+id/cir_avatar"
-        tools:text="120" />
+        tools:text="120" />
 
+    <TextView
+        android:id="@+id/tv_price_symbol"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="¥"
+        android:textColor="@color/color_f44541"
+        android:textSize="@dimen/sp_14"
+        android:textStyle="bold"
+        app:layout_constraintRight_toLeftOf="@+id/tv_price"
+        app:layout_constraintBaseline_toBaselineOf="@+id/tv_price" />
 
     <TextView
         android:id="@+id/tv_price_unit"

+ 7 - 1
teacher/src/main/java/com/cooleshow/teacher/adapter/MineVideoCourseAdapter.java

@@ -53,21 +53,27 @@ public class MineVideoCourseAdapter extends BaseQuickAdapter<VideoCourseListBean
         tv_title.setText(item.lessonName);
         //价格
         TextView tv_price = helper.getView(R.id.tv_price);
+        TextView tv_price_symbol = helper.getView(R.id.tv_price_symbol);
         boolean isVipType = TextUtils.equals(item.payType, VideoCoursePayType.VIP.getId());
         if (isVipType) {
+            tv_price_symbol.setVisibility(View.GONE);
             tv_price.setText("会员");
             tv_price.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_c76e21));
         } else {
             //收费
             tv_price.setText(UiUtils.getVideoCoursePriceText2(item.lessonPrice));
             if (UiUtils.isFree(item.lessonPrice)) {
+                tv_price_symbol.setVisibility(View.GONE);
                 tv_price.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_20bea0));
             } else {
+                tv_price_symbol.setVisibility(View.VISIBLE);
                 tv_price.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_ff0000));
             }
         }
         TextView tv_price_unit = helper.getView(R.id.tv_price_unit);
-        tv_price_unit.setText(String.format("/%d课时", item.lessonCount));
+        tv_price_unit.setText(String.format("%d课时", item.lessonCount));
+        TextView tv_music_num = helper.getView(R.id.tv_music_num);
+        tv_music_num.setText(item.getMusicScoreNum() + "首曲目");
 
         //购买人数
         TextView tv_buy_num = helper.getView(R.id.tv_buy_num);

+ 4 - 0
teacher/src/main/java/com/cooleshow/teacher/adapter/VideoCourseListAdapter.java

@@ -43,16 +43,20 @@ public class VideoCourseListAdapter extends BaseQuickAdapter<VideoCourseListBean
         tv_title.setText(item.lessonName);
         //价格
         TextView tv_price = helper.getView(R.id.tv_price);
+        TextView tv_price_symbol = helper.getView(R.id.tv_price_symbol);
         boolean isVipType = TextUtils.equals(item.payType, VideoCoursePayType.VIP.getId());
         if (isVipType) {
             tv_price.setText("会员");
+            tv_price_symbol.setVisibility(View.GONE);
             tv_price.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_c76e21));
         } else {
             //收费
             tv_price.setText(UiUtils.getVideoCoursePriceText2(item.lessonPrice));
             if (UiUtils.isFree(item.lessonPrice)) {
+                tv_price_symbol.setVisibility(View.GONE);
                 tv_price.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_20bea0));
             } else {
+                tv_price_symbol.setVisibility(View.VISIBLE);
                 tv_price.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_ff0000));
             }
         }

+ 9 - 0
teacher/src/main/java/com/cooleshow/teacher/bean/VideoCourseListBean.java

@@ -129,5 +129,14 @@ public class VideoCourseListBean {
         public String updateTime;
         public String username;
         public String payType;
+        public String musicScoreNum;
+
+        public String getMusicScoreNum() {
+            return musicScoreNum;
+        }
+
+        public void setMusicScoreNum(String musicScoreNum) {
+            this.musicScoreNum = musicScoreNum;
+        }
     }
 }

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

@@ -37,15 +37,22 @@ import java.util.List;
  * Author by pq, Date on 2022/5/9.
  */
 public class VideoCoursePageFragment extends BaseMVPFragment<FragmentVideoCoursePageLayoutBinding, VideoCoursePagePresenter> implements VideoCoursePageContract.VideoCoursePageView, View.OnClickListener {
+    public static final String TIP_CACHE_KEY = "video_course_tip_key";
     private MineVideoCourseAdapter mineVideoCourseAdapter;
 
     @Override
     protected void initView(View rootView) {
-        mViewBinding.llCreateVideo.setOnClickListener(this);
+
+        mViewBinding.commonHeader.setDataStyle(TIP_CACHE_KEY,R.drawable.icon_vip_custom_course_des_tag, getString(R.string.video_course_des_title), getString(R.string.video_course_des), R.drawable.icon_video_course_set,getString(R.string.create_video_course_text), new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                goCreate();
+            }
+        });
+
         mViewBinding.tvOpen.setOnClickListener(this);
-        mViewBinding.tvCreateVideoCourse.setOnClickListener(this);
         RecyclerView rvAddress = mViewBinding.recyclerView;
-        GridLayoutManager manager = new GridLayoutManager(getContext(), 2);
+        LinearLayoutManager manager =new LinearLayoutManager(getContext());
         rvAddress.setLayoutManager(manager);
         mineVideoCourseAdapter = new MineVideoCourseAdapter(MineVideoCourseActivity.TYPE_PASS);
         EmptyViewLayout mEmptyView = new EmptyViewLayout(getContext());
@@ -65,6 +72,13 @@ public class VideoCoursePageFragment extends BaseMVPFragment<FragmentVideoCourse
 
     }
 
+    private void goCreate() {
+        ARouter.getInstance()
+                .build(RouterPath.WebCenter.ACTIVITY_HTML)
+                .withString(WebConstants.WEB_URL, WebConstants.TEACHER_VIDEO_CREATE)
+                .navigation();
+    }
+
     private int currentPage;
 
     @Override
@@ -119,12 +133,6 @@ public class VideoCoursePageFragment extends BaseMVPFragment<FragmentVideoCourse
     @Override
     public void onClick(View view) {
         switch (view.getId()) {
-            case R.id.tv_create_video_course:
-                ARouter.getInstance()
-                        .build(RouterPath.WebCenter.ACTIVITY_HTML)
-                        .withString(WebConstants.WEB_URL, WebConstants.TEACHER_VIDEO_CREATE)
-                        .navigation();
-                break;
             case R.id.tv_open:
                 if (mViewBinding.tvOpen.getText().toString().equals("去认证")) {
                     ARouter.getInstance().build(RouterPath.WebCenter.ACTIVITY_HTML)

BIN
teacher/src/main/res/drawable-xhdpi/icon_video_course_set.png


BIN
teacher/src/main/res/drawable-xxhdpi/icon_video_course_set.png


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

@@ -24,6 +24,7 @@
 
             <androidx.recyclerview.widget.RecyclerView
                 android:id="@+id/recyclerView"
+                android:layout_marginTop="12dp"
                 android:layout_width="match_parent"
                 android:layout_height="match_parent"
                 android:overScrollMode="never"

+ 7 - 43
teacher/src/main/res/layout/fragment_video_course_page_layout.xml

@@ -7,52 +7,17 @@
     android:orientation="vertical">
 
     <LinearLayout
+        android:paddingEnd="14dp"
+        android:paddingStart="14dp"
         android:id="@+id/ll_content"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:orientation="vertical">
 
-
-        <androidx.constraintlayout.widget.ConstraintLayout
-            android:id="@+id/ll_create_video"
+        <com.cooleshow.teacher.widgets.HomePageCourseCommonHeaderView
+            android:id="@+id/common_header"
             android:layout_width="match_parent"
-            android:layout_height="@dimen/dp_56"
-            android:layout_marginLeft="14dp"
-            android:layout_marginTop="14dp"
-            android:layout_marginRight="14dp"
-            android:background="@drawable/bg_white_10dp"
-            android:gravity="center"
-            android:orientation="horizontal">
-
-            <TextView
-                android:layout_marginStart="14dp"
-                app:layout_constraintLeft_toLeftOf="parent"
-                app:layout_constraintBottom_toBottomOf="parent"
-                app:layout_constraintTop_toTopOf="parent"
-                android:textStyle="bold"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_marginLeft="2dp"
-                android:text="我的视频课"
-                android:textColor="@color/black_333"
-                android:textSize="@dimen/sp_18" />
-
-            <TextView
-                android:id="@+id/tv_create_video_course"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_marginEnd="14dp"
-                android:drawableRight="@drawable/icon_arrow_right_small_green"
-                android:drawablePadding="5dp"
-                android:gravity="center"
-                android:text="创建课程"
-                android:textStyle="bold"
-                android:textSize="@dimen/sp_16"
-                android:textColor="@color/color_2dc7aa"
-                app:layout_constraintBottom_toBottomOf="parent"
-                app:layout_constraintRight_toRightOf="parent"
-                app:layout_constraintTop_toTopOf="parent" />
-        </androidx.constraintlayout.widget.ConstraintLayout>
+            android:layout_height="wrap_content"/>
 
         <com.scwang.smart.refresh.layout.SmartRefreshLayout
             android:id="@+id/refreshLayout"
@@ -61,9 +26,8 @@
 
 
             <androidx.recyclerview.widget.RecyclerView
-                android:layout_marginStart="7dp"
-                android:layout_marginEnd="7dp"
                 android:id="@+id/recyclerView"
+                android:layout_marginTop="12dp"
                 android:layout_width="match_parent"
                 android:layout_height="match_parent"
                 android:overScrollMode="never"
@@ -77,7 +41,7 @@
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:visibility="gone"
-        tools:visibility="visible"
+        tools:visibility="gone"
         app:layout_constraintLeft_toLeftOf="parent"
         app:layout_constraintTop_toTopOf="parent">
 

+ 1 - 1
teacher/src/main/res/layout/item_home_page_live_course_list_layout.xml

@@ -8,7 +8,7 @@
     android:background="@drawable/bg_white_6dp"
     android:paddingStart="12dp"
     android:paddingEnd="12dp"
-    android:paddingBottom="9dp">
+    android:paddingBottom="14dp">
 
     <TextView
         android:drawableStart="@drawable/icon_live_course_time_tag"

+ 11 - 0
teacher/src/main/res/layout/item_video_course_list_layout.xml

@@ -86,6 +86,17 @@
         app:layout_constraintTop_toBottomOf="@+id/tv_title" />
 
     <TextView
+        android:id="@+id/tv_price_symbol"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="¥"
+        android:textColor="@color/color_f44541"
+        android:textSize="@dimen/sp_14"
+        android:textStyle="bold"
+        app:layout_constraintRight_toLeftOf="@+id/tv_price"
+        app:layout_constraintBaseline_toBaselineOf="@+id/tv_price" />
+
+    <TextView
         android:id="@+id/tv_price_unit"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"

+ 94 - 48
teacher/src/main/res/layout/layout_mine_video_course_item.xml

@@ -4,20 +4,20 @@
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
-    android:layout_marginLeft="6dp"
-    android:layout_marginTop="12dp"
-    android:layout_marginRight="6dp"
-    android:paddingBottom="9dp"
-    android:background="@drawable/bg_white_10dp">
+    android:layout_marginBottom="12dp"
+    android:background="@drawable/bg_white_6dp"
+    android:paddingBottom="9dp">
 
 
-    <ImageView
+    <com.cooleshow.base.widgets.QMUIRadiusImageView
         android:id="@+id/im_pic"
-        android:layout_width="match_parent"
-        android:layout_height="@dimen/dp_95"
+        android:layout_width="146dp"
+        android:layout_height="@dimen/dp_81"
+        android:layout_marginStart="12dp"
+        android:layout_marginTop="12dp"
         app:layout_constraintLeft_toLeftOf="parent"
         app:layout_constraintTop_toTopOf="parent"
-        app:qmui_corner_radius="5dp" />
+        app:qmui_corner_radius="6dp" />
 
     <TextView
         android:id="@+id/tv_course_status_tip"
@@ -34,7 +34,7 @@
         android:textColor="@color/color_2dc7aa"
         android:textSize="@dimen/sp_10"
         android:visibility="visible"
-        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintLeft_toLeftOf="@+id/im_pic"
         app:layout_constraintTop_toTopOf="@+id/im_pic"
         tools:visibility="visible" />
 
@@ -44,7 +44,7 @@
         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:background="@drawable/shape_66000000_3dp"
         android:gravity="center"
         android:paddingLeft="@dimen/dp_4"
         android:paddingRight="@dimen/dp_4"
@@ -54,62 +54,108 @@
         app:layout_constraintRight_toRightOf="@+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:layout_marginLeft="12dp"
+        android:layout_marginEnd="5dp"
         android:ellipsize="end"
         android:includeFontPadding="false"
-        android:maxLines="2"
-        android:text="从零开始学竖笛视频课"
+        android:maxLines="1"
         android:textColor="@color/color_1a1a1a"
-        android:textSize="@dimen/sp_14"
-        app:layout_constraintLeft_toLeftOf="parent"
+        android:textSize="@dimen/sp_15"
+        app:layout_constraintBottom_toTopOf="@+id/ll_tag"
+        app:layout_constraintLeft_toRightOf="@+id/im_pic"
         app:layout_constraintRight_toRightOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/im_pic" />
+        app:layout_constraintTop_toTopOf="@+id/im_pic"
+        app:layout_constraintVertical_chainStyle="packed"
+        tools:text="从零开始学竖笛视频课从零开始学竖笛视频课从零开始学竖笛视频课" />
 
+    <LinearLayout
+        android:id="@+id/ll_tag"
+        android:layout_marginTop="8dp"
+        android:orientation="horizontal"
+        app:layout_constraintBottom_toTopOf="@+id/tv_buy_num"
+        app:layout_constraintLeft_toLeftOf="@+id/tv_title"
+        app:layout_constraintTop_toBottomOf="@+id/tv_title"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content">
+        <TextView
+            android:visibility="gone"
+            android:id="@+id/tv_music_num"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:background="@drawable/shape_f5f6fa_3dp"
+            android:gravity="center"
+            android:includeFontPadding="false"
+            android:paddingStart="6dp"
+            android:paddingTop="1dp"
+            android:paddingEnd="6dp"
+            android:paddingBottom="1dp"
+            android:textColor="@color/color_777777"
+            android:textSize="@dimen/sp_11"
+            tools:text="3首曲目" />
+
+        <TextView
+            android:id="@+id/tv_price_unit"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginStart="4dp"
+            android:background="@drawable/shape_f5f6fa_3dp"
+            android:gravity="center"
+            android:includeFontPadding="false"
+            android:paddingStart="6dp"
+            android:paddingTop="1dp"
+            android:paddingEnd="6dp"
+            android:paddingBottom="1dp"
+            android:textColor="@color/color_777777"
+            android:textSize="@dimen/sp_11"
+            app:layout_constraintBaseline_toBaselineOf="@+id/tv_music_num"
+            app:layout_constraintLeft_toRightOf="@+id/tv_music_num"
+            tools:text="4课时" />
+    </LinearLayout>
+
+    <TextView
+        android:id="@+id/tv_buy_num"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="8dp"
+        android:background="@drawable/shape_12ff802c_2dp"
+        android:includeFontPadding="false"
+        android:paddingStart="4dp"
+        android:paddingTop="3dp"
+        android:paddingEnd="4dp"
+        android:paddingBottom="3dp"
+        android:textColor="@color/color_ff6827"
+        android:textSize="@dimen/sp_12"
+        android:visibility="visible"
+        app:layout_constraintBottom_toBottomOf="@+id/im_pic"
+        app:layout_constraintLeft_toLeftOf="@+id/tv_title"
+        app:layout_constraintTop_toBottomOf="@+id/ll_tag"
+        tools:text="6人已购买" />
 
     <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_16"
+        android:layout_marginEnd="12dp"
+        android:text="120"
+        android:textColor="@color/color_f44541"
+        android:textSize="@dimen/sp_18"
         android:textStyle="bold"
-        app:layout_constraintLeft_toLeftOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/tv_title" />
+        app:layout_constraintTop_toTopOf="@+id/tv_buy_num"
+        app:layout_constraintBottom_toBottomOf="@+id/tv_buy_num"
+        app:layout_constraintRight_toRightOf="parent" />
 
     <TextView
-        android:id="@+id/tv_price_unit"
+        android:id="@+id/tv_price_symbol"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_marginRight="11dp"
-        android:paddingStart="5dp"
-        android:text="/4课时"
-        android:textColor="@color/color_999999"
+        android:text="¥"
+        android:textColor="@color/color_f44541"
         android:textSize="@dimen/sp_14"
+        android:textStyle="bold"
         app:layout_constraintBaseline_toBaselineOf="@+id/tv_price"
-        app:layout_constraintLeft_toRightOf="@+id/tv_price" />
-
-    <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人已购买" />
+        app:layout_constraintRight_toLeftOf="@+id/tv_price" />
 
 </androidx.constraintlayout.widget.ConstraintLayout>

+ 3 - 0
teacher/src/main/res/values/strings.xml

@@ -62,5 +62,8 @@
     <string name="create_live_course_text">创建直播课</string>
     <string name="live_course_des_title">什么是直播课?</string>
     <string name="live_course_des">直播课是老师根据教学目的精心编排的课程,按照固定时间进行直播授课。您可根据老师开放的课程内容,选择自己感兴趣的课程进行学习。如果您错过了直播,也不必担心,可以随时观看直播回放。</string>
+    <string name="video_course_des_title">什么是视频课?</string>
+    <string name="video_course_des">视频课是由老师根据教学内容精心录制的课程,购买后永久有效,您可以随时观看学习。</string>
+    <string name="create_video_course_text">创建视频课</string>
 
 </resources>