Browse Source

修改老师端学生端曲谱tag标记,支持多个

Pq 2 years ago
parent
commit
f4717380eb
20 changed files with 183 additions and 169 deletions
  1. 52 0
      BaseLibrary/src/main/java/com/cooleshow/base/utils/MusicSheetUtils.java
  2. 0 0
      BaseLibrary/src/main/res/drawable/shape_01b84f_border.xml
  3. 0 0
      BaseLibrary/src/main/res/drawable/shape_3591ce_border.xml
  4. 0 0
      BaseLibrary/src/main/res/drawable/shape_cd863e_border.xml
  5. 1 0
      student/src/main/java/com/cooleshow/student/bean/HomeHotMusicSheetBean.java
  6. 4 4
      student/src/main/java/com/cooleshow/student/ui/live/LiveRoomActivity.java
  7. 13 17
      student/src/main/java/com/cooleshow/student/widgets/HomeHotMusicSheetItemView.java
  8. 25 15
      student/src/main/res/layout/view_hot_music_sheet_child_layout.xml
  9. 15 21
      teacher/src/main/java/com/cooleshow/teacher/adapter/HomePageSheetMusicAdapter.java
  10. 16 22
      teacher/src/main/java/com/cooleshow/teacher/adapter/MineScoreAdapter.java
  11. 1 0
      teacher/src/main/java/com/cooleshow/teacher/bean/HomeHotMusicSheetBean.java
  12. 1 0
      teacher/src/main/java/com/cooleshow/teacher/bean/HomePageSheetMusicListBean.java
  13. 1 0
      teacher/src/main/java/com/cooleshow/teacher/bean/MusicSheetListBean.java
  14. 13 22
      teacher/src/main/java/com/cooleshow/teacher/widgets/HomeHotMusicSheetItemView.java
  15. 0 7
      teacher/src/main/res/drawable/shape_01b84f_border.xml
  16. 0 7
      teacher/src/main/res/drawable/shape_3591ce_border.xml
  17. 0 7
      teacher/src/main/res/drawable/shape_cd863e_border.xml
  18. 12 14
      teacher/src/main/res/layout/item_home_page_sheet_music_layout.xml
  19. 13 14
      teacher/src/main/res/layout/layout_mine_score_item.xml
  20. 16 19
      teacher/src/main/res/layout/view_hot_music_sheet_child_layout.xml

+ 52 - 0
BaseLibrary/src/main/java/com/cooleshow/base/utils/MusicSheetUtils.java

@@ -0,0 +1,52 @@
+package com.cooleshow.base.utils;
+
+import android.content.Context;
+import android.text.TextUtils;
+import android.view.Gravity;
+import android.view.ViewGroup;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import com.cooleshow.base.R;
+
+/**
+ * Author by pq, Date on 2022/9/21.
+ */
+public class MusicSheetUtils {
+    public static final String CHARGE_TYPE_FREE = "FREE";
+    public static final String CHARGE_TYPE_VIP = "VIP";
+    public static final String CHARGE_TYPE_CHARGE = "CHARGE";
+    public static void createTag(Context context,ViewGroup viewParent, String chargeType) {
+        TextView textView = new TextView(context);
+        textView.setWidth(SizeUtils.dp2px(30));
+        textView.setHeight(SizeUtils.dp2px(17));
+        textView.setTextSize(10);
+        textView.setGravity(Gravity.CENTER);
+        setTagStyle(context,chargeType, textView);
+        LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
+        if (viewParent.getChildCount() >= 1) {
+            params.setMargins(SizeUtils.dp2px(4), 0, 0, 0);
+        }
+        viewParent.addView(textView, params);
+    }
+
+    private static void setTagStyle(Context context,String chargeType, TextView tvTag) {
+        if (TextUtils.equals(chargeType, CHARGE_TYPE_FREE)) {
+            tvTag.setText("免费");
+            tvTag.setTextColor(context.getResources().getColor(com.cooleshow.base.R.color.color_01b84f));
+            tvTag.setBackgroundResource(R.drawable.shape_01b84f_border);
+            return;
+        }
+        if (TextUtils.equals(chargeType, CHARGE_TYPE_VIP)) {
+            tvTag.setText("会员");
+            tvTag.setTextColor(context.getResources().getColor(com.cooleshow.base.R.color.color_cd863e));
+            tvTag.setBackgroundResource(R.drawable.shape_cd863e_border);
+            return;
+        }
+        if (TextUtils.equals(chargeType, CHARGE_TYPE_CHARGE)) {
+            tvTag.setText("点播");
+            tvTag.setTextColor(context.getResources().getColor(com.cooleshow.base.R.color.color_3591ce));
+            tvTag.setBackgroundResource(R.drawable.shape_3591ce_border);
+        }
+    }
+}

+ 0 - 0
student/src/main/res/drawable/shape_01b84f_border.xml → BaseLibrary/src/main/res/drawable/shape_01b84f_border.xml


+ 0 - 0
student/src/main/res/drawable/shape_3591ce_border.xml → BaseLibrary/src/main/res/drawable/shape_3591ce_border.xml


+ 0 - 0
student/src/main/res/drawable/shape_cd863e_border.xml → BaseLibrary/src/main/res/drawable/shape_cd863e_border.xml


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

@@ -120,5 +120,6 @@ public class HomeHotMusicSheetBean {
         public int userId;
         public String xmlFileUrl;
         public String exquisiteFlag;//是否是精品曲目 0否 1是
+        public String paymentType;
     }
 }

+ 4 - 4
student/src/main/java/com/cooleshow/student/ui/live/LiveRoomActivity.java

@@ -558,7 +558,7 @@ public class LiveRoomActivity extends BaseMVPActivity<ActivityLiveroomLayoutBind
         }
         if (!mLiveRoomShareDialog.isShowing()) {
             mLiveRoomShareDialog.show();
-        }pq
+        }
         mLiveRoomShareDialog.setData(mRoomInfoBean.speakerPic, mRoomInfoBean.speakerName, mRoomInfoBean.roomUid);
     }
 
@@ -2130,11 +2130,11 @@ public class LiveRoomActivity extends BaseMVPActivity<ActivityLiveroomLayoutBind
         return mFlJoinBarrage.getVisibility() != View.VISIBLE && mFlSnapUpBarrage.getVisibility() != View.VISIBLE;
     }
 
-    private void shareLive(File imagfile) {
+    private void shareLive(File imgfile) {
         if (mLiveRoomShareDialog != null && mLiveRoomShareDialog.isShowing()) {
             mLiveRoomShareDialog.dismiss();
         }
-        this.targetShareImgFile = imagfile;
+        this.targetShareImgFile = imgfile;
         ShareAction ShareAction = new ShareAction(this).setDisplayList(
                 SHARE_MEDIA.WEIXIN, SHARE_MEDIA.WEIXIN_CIRCLE, SHARE_MEDIA.SINA)
                 .setShareboardclickCallback(new ShareBoardlistener() {
@@ -2152,7 +2152,7 @@ public class LiveRoomActivity extends BaseMVPActivity<ActivityLiveroomLayoutBind
                                 ToastUtil.getInstance().show(getApplicationContext(), "应用未安装,分享失败");
                                 return;
                             }
-                            UMImage image = new UMImage(LiveRoomActivity.this, file);//bitmap文件
+                            UMImage image = new UMImage(LiveRoomActivity.this, imgfile);//bitmap文件
                             image.setThumb(image);
                             image.compressStyle = UMImage.CompressStyle.SCALE;
                             new ShareAction(LiveRoomActivity.this).withMedia(image)

+ 13 - 17
student/src/main/java/com/cooleshow/student/widgets/HomeHotMusicSheetItemView.java

@@ -3,6 +3,7 @@ package com.cooleshow.student.widgets;
 import android.content.Context;
 import android.text.TextUtils;
 import android.util.AttributeSet;
+import android.view.Gravity;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
@@ -14,6 +15,7 @@ import android.widget.TextView;
 import com.alibaba.android.arouter.launcher.ARouter;
 import com.cooleshow.base.common.WebConstants;
 import com.cooleshow.base.router.RouterPath;
+import com.cooleshow.base.utils.MusicSheetUtils;
 import com.cooleshow.base.utils.SizeUtils;
 import com.cooleshow.base.utils.UiUtils;
 import com.cooleshow.student.R;
@@ -37,6 +39,7 @@ public class HomeHotMusicSheetItemView extends FrameLayout {
     private View mViewLine;
     private HomeHotMusicSheetBean.RowsBean mBean;
     private ImageView mIvGoodTag;
+    private LinearLayout mTagContainer;
 
     public HomeHotMusicSheetItemView(@NonNull Context context) {
         this(context, null);
@@ -53,7 +56,7 @@ public class HomeHotMusicSheetItemView extends FrameLayout {
 
     private void init() {
         LayoutInflater.from(getContext()).inflate(R.layout.view_hot_music_sheet_child_layout, this);
-        mTvTag = findViewById(R.id.tv_tag);
+        mTagContainer = findViewById(R.id.ll_tag_container);
         mIvGoodTag = findViewById(R.id.iv_good_tag);
         mTvName = findViewById(R.id.tv_name);
         mTvAuthor = findViewById(R.id.tv_author);
@@ -109,22 +112,15 @@ public class HomeHotMusicSheetItemView extends FrameLayout {
         //精品曲目标记
         mIvGoodTag.setVisibility(TextUtils.equals(data.exquisiteFlag, "1") ? View.VISIBLE : View.GONE);
 
-        if (TextUtils.equals(data.chargeType, CHARGE_TYPE_FREE)) {
-            mTvTag.setText("免费");
-            mTvTag.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_01b84f));
-            mTvTag.setBackgroundResource(R.drawable.shape_01b84f_border);
-            return;
-        }
-        if (TextUtils.equals(data.chargeType, CHARGE_TYPE_VIP)) {
-            mTvTag.setText("会员");
-            mTvTag.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_cd863e));
-            mTvTag.setBackgroundResource(R.drawable.shape_cd863e_border);
-            return;
-        }
-        if (TextUtils.equals(data.chargeType, CHARGE_TYPE_CHARGE)) {
-            mTvTag.setText("点播");
-            mTvTag.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_3591ce));
-            mTvTag.setBackgroundResource(R.drawable.shape_3591ce_border);
+
+        mTagContainer.removeAllViews();
+        if (!TextUtils.isEmpty(data.paymentType)) {
+            String[] split = data.paymentType.split(",");
+            if (split != null && split.length > 0) {
+                for (int i = 0; i < split.length; i++) {
+                    MusicSheetUtils.createTag(getContext(), mTagContainer, split[i]);
+                }
+            }
         }
     }
 

+ 25 - 15
student/src/main/res/layout/view_hot_music_sheet_child_layout.xml

@@ -7,26 +7,36 @@
     android:paddingStart="11dp"
     android:paddingEnd="11dp">
 
-    <TextView
+
+    <LinearLayout
+        android:id="@+id/ll_tag_container"
+        android:layout_width="wrap_content"
+        android:layout_height="17dp"
+        android:orientation="horizontal"
         app:layout_constraintVertical_chainStyle="packed"
         app:layout_constraintBottom_toTopOf="@+id/tv_upload_author"
-        android:id="@+id/tv_tag"
-        android:layout_width="30dp"
-        android:layout_height="17dp"
-        android:background="@drawable/shape_01b84f_border"
-        android:gravity="center"
-        android:text="免费"
-        android:textSize="@dimen/sp_10"
         app:layout_constraintLeft_toLeftOf="parent"
         app:layout_constraintTop_toTopOf="parent" />
 
+<!--    <TextView-->
+<!--       -->
+<!--        android:id="@+id/tv_tag"-->
+<!--        android:layout_width="30dp"-->
+<!--        android:layout_height="17dp"-->
+<!--        android:background="@drawable/shape_01b84f_border"-->
+<!--        android:gravity="center"-->
+<!--        android:text="免费"-->
+<!--        android:textSize="@dimen/sp_10"-->
+<!--        app:layout_constraintLeft_toLeftOf="parent"-->
+<!--        app:layout_constraintTop_toTopOf="parent" />-->
+
     <ImageView
         android:visibility="gone"
         android:id="@+id/iv_good_tag"
         android:layout_marginStart="5dp"
-        app:layout_constraintLeft_toRightOf="@+id/tv_tag"
-        app:layout_constraintBottom_toBottomOf="@+id/tv_tag"
-        app:layout_constraintTop_toTopOf="@+id/tv_tag"
+        app:layout_constraintLeft_toRightOf="@+id/ll_tag_container"
+        app:layout_constraintBottom_toBottomOf="@+id/ll_tag_container"
+        app:layout_constraintTop_toTopOf="@+id/ll_tag_container"
         android:src="@drawable/icon_home_good_music_sheet_tag"
         android:layout_width="14dp"
         android:layout_height="17dp"/>
@@ -42,10 +52,10 @@
         android:paddingStart="6dp"
         android:textColor="@color/color_1a1a1a"
         android:textSize="@dimen/sp_16"
-        app:layout_constraintBottom_toBottomOf="@+id/tv_tag"
+        app:layout_constraintBottom_toBottomOf="@+id/ll_tag_container"
         app:layout_constraintLeft_toRightOf="@+id/iv_good_tag"
         app:layout_constraintRight_toLeftOf="@+id/tv_author"
-        app:layout_constraintTop_toTopOf="@+id/tv_tag"
+        app:layout_constraintTop_toTopOf="@+id/ll_tag_container"
         tools:text="维瓦尔第 E第一维瓦尔第维瓦尔第维瓦尔第" />
 
     <TextView
@@ -87,8 +97,8 @@
         android:textColor="@color/color_999999"
         android:textSize="@dimen/sp_12"
         app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintLeft_toLeftOf="@+id/tv_tag"
-        app:layout_constraintTop_toBottomOf="@+id/tv_tag"
+        app:layout_constraintLeft_toLeftOf="@+id/ll_tag_container"
+        app:layout_constraintTop_toBottomOf="@+id/ll_tag_container"
         tools:text="上传者:一把剑走天涯" />
 
     <LinearLayout

+ 15 - 21
teacher/src/main/java/com/cooleshow/teacher/adapter/HomePageSheetMusicAdapter.java

@@ -2,6 +2,7 @@ package com.cooleshow.teacher.adapter;
 
 import android.media.Image;
 import android.text.TextUtils;
+import android.view.Gravity;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
@@ -16,6 +17,7 @@ import com.chad.library.adapter.base.viewholder.BaseViewHolder;
 import com.cooleshow.base.constanst.SheetMusicConstants;
 import com.cooleshow.base.presenter.view.BaseView;
 import com.cooleshow.base.utils.GlideUtils;
+import com.cooleshow.base.utils.MusicSheetUtils;
 import com.cooleshow.base.utils.SizeUtils;
 import com.cooleshow.base.utils.UiUtils;
 import com.cooleshow.teacher.R;
@@ -39,7 +41,7 @@ public class HomePageSheetMusicAdapter extends BaseQuickAdapter<HomePageSheetMus
         //曲谱名称
         holder.setText(R.id.tv_name, bean.musicSheetName);
         //音乐人
-        holder.setText(R.id.tv_upload_author,String.format("作曲:%s", bean.composer));
+        holder.setText(R.id.tv_upload_author, String.format("作曲:%s", bean.composer));
         //创建人
         ImageView iv_img = holder.getView(R.id.im_music_mark);
         if (!TextUtils.isEmpty(bean.titleImg)) {
@@ -48,23 +50,15 @@ public class HomePageSheetMusicAdapter extends BaseQuickAdapter<HomePageSheetMus
             iv_img.setImageResource(R.drawable.icon_music_mark);
         }
 
-        TextView mTvTag = holder.getView(R.id.tv_tag);
-        switch (bean.chargeType) {
-            case "FREE":
-                mTvTag.setText("免费");
-                mTvTag.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_01b84f));
-                mTvTag.setBackgroundResource(R.drawable.shape_01b84f_border);
-                break;
-            case "VIP":
-                mTvTag.setText("会员");
-                mTvTag.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_cd863e));
-                mTvTag.setBackgroundResource(R.drawable.shape_cd863e_border);
-                break;
-            case "CHARGE":
-                mTvTag.setText("点播");
-                mTvTag.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_3591ce));
-                mTvTag.setBackgroundResource(R.drawable.shape_3591ce_border);
-                break;
+        LinearLayout ll_tag_container = holder.getView(R.id.ll_tag_container);
+        ll_tag_container.removeAllViews();
+        if (!TextUtils.isEmpty(bean.paymentType)) {
+            String[] split = bean.paymentType.split(",");
+            if (split != null && split.length > 0) {
+                for (int i = 0; i < split.length; i++) {
+                    MusicSheetUtils.createTag(getContext(), ll_tag_container, split[i]);
+                }
+            }
         }
 
         //subject
@@ -97,10 +91,10 @@ public class HomePageSheetMusicAdapter extends BaseQuickAdapter<HomePageSheetMus
         }
 
         //精品标记
-        ImageView iv_good_tag=holder.getView(R.id.iv_good_tag);
-        if(TextUtils.equals(bean.exquisiteFlag,"1")){
+        ImageView iv_good_tag = holder.getView(R.id.iv_good_tag);
+        if (TextUtils.equals(bean.exquisiteFlag, "1")) {
             iv_good_tag.setVisibility(View.VISIBLE);
-        }else{
+        } else {
             iv_good_tag.setVisibility(View.GONE);
         }
     }

+ 16 - 22
teacher/src/main/java/com/cooleshow/teacher/adapter/MineScoreAdapter.java

@@ -2,6 +2,7 @@ package com.cooleshow.teacher.adapter;
 
 import android.text.TextUtils;
 import android.util.Log;
+import android.view.Gravity;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
@@ -20,6 +21,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.MusicSheetUtils;
 import com.cooleshow.base.utils.SizeUtils;
 import com.cooleshow.teacher.R;
 import com.cooleshow.teacher.bean.MineLiveCourseListBean;
@@ -50,7 +52,7 @@ public class MineScoreAdapter extends BaseQuickAdapter<MusicSheetListBean.RowsBe
     @Override
     protected void convert(BaseViewHolder helper, MusicSheetListBean.RowsBean item) {
         ImageView im_music_mark = helper.getView(R.id.im_music_mark);
-        TextView mTvTag = helper.getView(R.id.tv_tag);
+        LinearLayout ll_tag_container = helper.getView(R.id.ll_tag_container);
         TextView tv_name = helper.getView(R.id.tv_name);
         TextView tv_author_name = helper.getView(R.id.tv_author);
         TextView tv_upload_author = helper.getView(R.id.tv_upload_author);
@@ -69,7 +71,7 @@ public class MineScoreAdapter extends BaseQuickAdapter<MusicSheetListBean.RowsBe
             tv_upload_author.setText(String.format("作曲:%s", item.composer));
         }
         TextView tv_status_tip = helper.getView(R.id.tv_status_tip);
-        View iv_play=helper.getView(R.id.iv_play);
+        View iv_play = helper.getView(R.id.iv_play);
         if (TextUtils.equals(scoreStatus, MineScoreActivity.TYPE_PASS)) {
             tv_status_tip.setText("下架");
             tv_status_tip.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_008ae0));
@@ -106,24 +108,16 @@ public class MineScoreAdapter extends BaseQuickAdapter<MusicSheetListBean.RowsBe
             im_music_mark.setImageResource(R.drawable.icon_music_mark);
         }
 
-
-        switch (item.chargeType) {
-            case "FREE":
-                mTvTag.setText("免费");
-                mTvTag.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_01b84f));
-                mTvTag.setBackgroundResource(R.drawable.shape_01b84f_border);
-                break;
-            case "VIP":
-                mTvTag.setText("会员");
-                mTvTag.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_cd863e));
-                mTvTag.setBackgroundResource(R.drawable.shape_cd863e_border);
-                break;
-            case "CHARGE":
-                mTvTag.setText("点播");
-                mTvTag.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_3591ce));
-                mTvTag.setBackgroundResource(R.drawable.shape_3591ce_border);
-                break;
+        ll_tag_container.removeAllViews();
+        if (!TextUtils.isEmpty(item.paymentType)) {
+            String[] split = item.paymentType.split(",");
+            if (split != null && split.length > 0) {
+                for (int i = 0; i < split.length; i++) {
+                    MusicSheetUtils.createTag(getContext(), ll_tag_container, split[i]);
+                }
+            }
         }
+
         tv_name.setText(item.musicSheetName);
 
         //subject
@@ -159,10 +153,10 @@ public class MineScoreAdapter extends BaseQuickAdapter<MusicSheetListBean.RowsBe
         }
 
         //精品标记
-        ImageView iv_good_tag=helper.getView(R.id.iv_good_tag);
-        if(TextUtils.equals(item.exquisiteFlag,"1")){
+        ImageView iv_good_tag = helper.getView(R.id.iv_good_tag);
+        if (TextUtils.equals(item.exquisiteFlag, "1")) {
             iv_good_tag.setVisibility(View.VISIBLE);
-        }else{
+        } else {
             iv_good_tag.setVisibility(View.GONE);
         }
     }

+ 1 - 0
teacher/src/main/java/com/cooleshow/teacher/bean/HomeHotMusicSheetBean.java

@@ -120,5 +120,6 @@ public class HomeHotMusicSheetBean {
         public int userId;
         public String xmlFileUrl;
         public String exquisiteFlag;
+        public String paymentType;
     }
 }

+ 1 - 0
teacher/src/main/java/com/cooleshow/teacher/bean/HomePageSheetMusicListBean.java

@@ -198,5 +198,6 @@ public class HomePageSheetMusicListBean {
         public String xmlFileUrl;
         public String titleImg;
         public String exquisiteFlag;//精品标志(0:否;1:是)
+        public String paymentType;
     }
 }

+ 1 - 0
teacher/src/main/java/com/cooleshow/teacher/bean/MusicSheetListBean.java

@@ -104,5 +104,6 @@ public class MusicSheetListBean {
         public String xmlFileUrl;
         public String titleImg;
         public String exquisiteFlag;//精品标志(0:否;1:是)
+        public String paymentType;
     }
 }

+ 13 - 22
teacher/src/main/java/com/cooleshow/teacher/widgets/HomeHotMusicSheetItemView.java

@@ -3,6 +3,7 @@ package com.cooleshow.teacher.widgets;
 import android.content.Context;
 import android.text.TextUtils;
 import android.util.AttributeSet;
+import android.view.Gravity;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
@@ -14,6 +15,7 @@ import android.widget.TextView;
 import com.alibaba.android.arouter.launcher.ARouter;
 import com.cooleshow.base.common.WebConstants;
 import com.cooleshow.base.router.RouterPath;
+import com.cooleshow.base.utils.MusicSheetUtils;
 import com.cooleshow.base.utils.SizeUtils;
 import com.cooleshow.base.utils.UiUtils;
 import com.cooleshow.teacher.R;
@@ -26,10 +28,6 @@ import androidx.annotation.Nullable;
  * Author by pq, Date on 2022/8/8.
  */
 public class HomeHotMusicSheetItemView extends FrameLayout {
-    public static final String CHARGE_TYPE_FREE = "FREE";
-    public static final String CHARGE_TYPE_VIP = "VIP";
-    public static final String CHARGE_TYPE_CHARGE = "CHARGE";
-    private TextView mTvTag;
     private TextView mTvName;
     private TextView mTvAuthor;
     private TextView mTvUploadAuthor;
@@ -38,6 +36,7 @@ public class HomeHotMusicSheetItemView extends FrameLayout {
     private HomeHotMusicSheetBean.RowsBean mBean;
     private boolean isGood = false;//是否是精品曲目
     private ImageView mIvGoodTag;
+    private LinearLayout mTagContainer;
 
     public HomeHotMusicSheetItemView(@NonNull Context context) {
         this(context, null);
@@ -54,7 +53,7 @@ public class HomeHotMusicSheetItemView extends FrameLayout {
 
     private void init() {
         LayoutInflater.from(getContext()).inflate(R.layout.view_hot_music_sheet_child_layout, this);
-        mTvTag = findViewById(R.id.tv_tag);
+        mTagContainer = findViewById(R.id.ll_tag_container);
         mTvName = findViewById(R.id.tv_name);
         mTvAuthor = findViewById(R.id.tv_author);
         mTvUploadAuthor = findViewById(R.id.tv_upload_author);
@@ -108,23 +107,14 @@ public class HomeHotMusicSheetItemView extends FrameLayout {
 
         //精品标记
         mIvGoodTag.setVisibility(TextUtils.equals(data.exquisiteFlag, "1") ? View.VISIBLE : View.GONE);
-
-        if (TextUtils.equals(data.chargeType, CHARGE_TYPE_FREE)) {
-            mTvTag.setText("免费");
-            mTvTag.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_01b84f));
-            mTvTag.setBackgroundResource(R.drawable.shape_01b84f_border);
-            return;
-        }
-        if (TextUtils.equals(data.chargeType, CHARGE_TYPE_VIP)) {
-            mTvTag.setText("会员");
-            mTvTag.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_cd863e));
-            mTvTag.setBackgroundResource(R.drawable.shape_cd863e_border);
-            return;
-        }
-        if (TextUtils.equals(data.chargeType, CHARGE_TYPE_CHARGE)) {
-            mTvTag.setText("点播");
-            mTvTag.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_3591ce));
-            mTvTag.setBackgroundResource(R.drawable.shape_3591ce_border);
+        mTagContainer.removeAllViews();
+        if (!TextUtils.isEmpty(data.paymentType)) {
+            String[] split = data.paymentType.split(",");
+            if (split != null && split.length > 0) {
+                for (int i = 0; i < split.length; i++) {
+                    MusicSheetUtils.createTag(getContext(), mTagContainer, split[i]);
+                }
+            }
         }
     }
 
@@ -155,4 +145,5 @@ public class HomeHotMusicSheetItemView extends FrameLayout {
             mViewLine.setVisibility(isShow ? View.VISIBLE : View.INVISIBLE);
         }
     }
+
 }

+ 0 - 7
teacher/src/main/res/drawable/shape_01b84f_border.xml

@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<shape xmlns:android="http://schemas.android.com/apk/res/android">
-    <stroke
-        android:width="0.5dp"
-        android:color="@color/color_01b84f" />
-    <corners android:radius="4dp" />
-</shape>

+ 0 - 7
teacher/src/main/res/drawable/shape_3591ce_border.xml

@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<shape xmlns:android="http://schemas.android.com/apk/res/android">
-    <stroke
-        android:width="0.5dp"
-        android:color="@color/color_3591ce" />
-    <corners android:radius="4dp" />
-</shape>

+ 0 - 7
teacher/src/main/res/drawable/shape_cd863e_border.xml

@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<shape xmlns:android="http://schemas.android.com/apk/res/android">
-    <stroke
-        android:width="0.5dp"
-        android:color="@color/color_cd863e" />
-    <corners android:radius="4dp" />
-</shape>

+ 12 - 14
teacher/src/main/res/layout/item_home_page_sheet_music_layout.xml

@@ -21,27 +21,25 @@
         app:qmui_corner_radius="5dp" />
 
 
-    <TextView
-        android:id="@+id/tv_tag"
-        android:layout_width="30dp"
+    <LinearLayout
+        android:orientation="horizontal"
+        android:id="@+id/ll_tag_container"
+        android:layout_width="wrap_content"
         android:layout_height="17dp"
         android:layout_marginStart="11dp"
-        android:background="@drawable/shape_01b84f_border"
-        android:gravity="center"
-        android:text="免费"
-        android:textSize="@dimen/sp_10"
         app:layout_constraintBottom_toTopOf="@+id/tv_upload_author"
         app:layout_constraintLeft_toRightOf="@+id/im_music_mark"
         app:layout_constraintTop_toTopOf="@+id/im_music_mark"
         app:layout_constraintVertical_chainStyle="packed" />
 
+
     <ImageView
         android:visibility="gone"
         android:id="@+id/iv_good_tag"
         android:layout_marginStart="5dp"
-        app:layout_constraintLeft_toRightOf="@+id/tv_tag"
-        app:layout_constraintBottom_toBottomOf="@+id/tv_tag"
-        app:layout_constraintTop_toTopOf="@+id/tv_tag"
+        app:layout_constraintLeft_toRightOf="@+id/ll_tag_container"
+        app:layout_constraintBottom_toBottomOf="@+id/ll_tag_container"
+        app:layout_constraintTop_toTopOf="@+id/ll_tag_container"
         android:src="@drawable/icon_home_good_music_sheet_tag"
         android:layout_width="14dp"
         android:layout_height="17dp"/>
@@ -57,8 +55,8 @@
         android:textColor="@color/color_999999"
         android:textSize="@dimen/sp_12"
         app:layout_constraintBottom_toBottomOf="@+id/im_music_mark"
-        app:layout_constraintLeft_toLeftOf="@+id/tv_tag"
-        app:layout_constraintTop_toBottomOf="@+id/tv_tag"
+        app:layout_constraintLeft_toLeftOf="@+id/ll_tag_container"
+        app:layout_constraintTop_toBottomOf="@+id/ll_tag_container"
         tools:text="上传者:一把剑走天涯" />
 
     <TextView
@@ -72,10 +70,10 @@
         android:paddingStart="6dp"
         android:textColor="@color/color_1a1a1a"
         android:textSize="@dimen/sp_16"
-        app:layout_constraintBottom_toBottomOf="@+id/tv_tag"
+        app:layout_constraintBottom_toBottomOf="@+id/ll_tag_container"
         app:layout_constraintLeft_toRightOf="@+id/iv_good_tag"
         app:layout_constraintRight_toLeftOf="@+id/fl_status"
-        app:layout_constraintTop_toTopOf="@+id/tv_tag"
+        app:layout_constraintTop_toTopOf="@+id/ll_tag_container"
         tools:text="维瓦尔第 E第一维瓦尔第维瓦尔第维瓦尔第E第一维瓦尔第维瓦尔第维瓦尔第E第一维瓦尔第维瓦尔第维瓦尔第" />
 
     <TextView

+ 13 - 14
teacher/src/main/res/layout/layout_mine_score_item.xml

@@ -20,15 +20,14 @@
         app:layout_constraintTop_toTopOf="parent"
         app:qmui_corner_radius="5dp" />
 
-    <TextView
-        android:id="@+id/tv_tag"
-        android:layout_width="30dp"
+
+
+    <LinearLayout
+        android:orientation="horizontal"
+        android:id="@+id/ll_tag_container"
+        android:layout_width="wrap_content"
         android:layout_height="17dp"
         android:layout_marginStart="11dp"
-        android:background="@drawable/shape_01b84f_border"
-        android:gravity="center"
-        android:text="免费"
-        android:textSize="@dimen/sp_10"
         app:layout_constraintBottom_toTopOf="@+id/tv_upload_author"
         app:layout_constraintLeft_toRightOf="@+id/im_music_mark"
         app:layout_constraintTop_toTopOf="@+id/im_music_mark"
@@ -38,9 +37,9 @@
         android:visibility="gone"
         android:id="@+id/iv_good_tag"
         android:layout_marginStart="5dp"
-        app:layout_constraintLeft_toRightOf="@+id/tv_tag"
-        app:layout_constraintBottom_toBottomOf="@+id/tv_tag"
-        app:layout_constraintTop_toTopOf="@+id/tv_tag"
+        app:layout_constraintLeft_toRightOf="@+id/ll_tag_container"
+        app:layout_constraintBottom_toBottomOf="@+id/ll_tag_container"
+        app:layout_constraintTop_toTopOf="@+id/ll_tag_container"
         android:src="@drawable/icon_home_good_music_sheet_tag"
         android:layout_width="14dp"
         android:layout_height="17dp"/>
@@ -57,8 +56,8 @@
         android:textColor="@color/color_999999"
         android:textSize="@dimen/sp_12"
         app:layout_constraintBottom_toBottomOf="@+id/im_music_mark"
-        app:layout_constraintLeft_toLeftOf="@+id/tv_tag"
-        app:layout_constraintTop_toBottomOf="@+id/tv_tag"
+        app:layout_constraintLeft_toLeftOf="@+id/ll_tag_container"
+        app:layout_constraintTop_toBottomOf="@+id/ll_tag_container"
         tools:text="上传者:一把剑走天涯" />
 
     <TextView
@@ -72,10 +71,10 @@
         android:paddingStart="6dp"
         android:textColor="@color/color_1a1a1a"
         android:textSize="@dimen/sp_16"
-        app:layout_constraintBottom_toBottomOf="@+id/tv_tag"
+        app:layout_constraintBottom_toBottomOf="@+id/ll_tag_container"
         app:layout_constraintLeft_toRightOf="@+id/iv_good_tag"
         app:layout_constraintRight_toLeftOf="@+id/tv_author"
-        app:layout_constraintTop_toTopOf="@+id/tv_tag"
+        app:layout_constraintTop_toTopOf="@+id/ll_tag_container"
         tools:text="维瓦尔第 E第一维瓦尔第维瓦尔第维瓦尔第" />
 
     <TextView

+ 16 - 19
teacher/src/main/res/layout/view_hot_music_sheet_child_layout.xml

@@ -7,29 +7,26 @@
     android:paddingStart="11dp"
     android:paddingEnd="11dp">
 
-    <TextView
-        android:id="@+id/tv_tag"
-        android:layout_width="30dp"
+    <LinearLayout
+        android:id="@+id/ll_tag_container"
+        android:layout_width="wrap_content"
         android:layout_height="17dp"
         android:layout_marginTop="17dp"
-        android:background="@drawable/shape_01b84f_border"
-        android:gravity="center"
-        android:text="免费"
-        android:textSize="@dimen/sp_10"
+        android:orientation="horizontal"
         app:layout_constraintLeft_toLeftOf="parent"
         app:layout_constraintTop_toTopOf="parent" />
 
 
     <ImageView
-        android:visibility="gone"
         android:id="@+id/iv_good_tag"
+        android:layout_width="14dp"
+        android:layout_height="17dp"
         android:layout_marginStart="5dp"
-        app:layout_constraintLeft_toRightOf="@+id/tv_tag"
-        app:layout_constraintBottom_toBottomOf="@+id/tv_tag"
-        app:layout_constraintTop_toTopOf="@+id/tv_tag"
         android:src="@drawable/icon_home_good_music_sheet_tag"
-        android:layout_width="14dp"
-        android:layout_height="17dp"/>
+        android:visibility="gone"
+        app:layout_constraintBottom_toBottomOf="@+id/ll_tag_container"
+        app:layout_constraintLeft_toRightOf="@+id/ll_tag_container"
+        app:layout_constraintTop_toTopOf="@+id/ll_tag_container" />
 
     <TextView
         android:id="@+id/tv_name"
@@ -37,15 +34,15 @@
         android:layout_height="wrap_content"
         android:ellipsize="end"
         android:includeFontPadding="false"
-        android:maxWidth="129dp"
         android:lines="1"
+        android:maxWidth="129dp"
         android:paddingStart="6dp"
         android:textColor="@color/color_1a1a1a"
         android:textSize="@dimen/sp_16"
-        app:layout_constraintBottom_toBottomOf="@+id/tv_tag"
+        app:layout_constraintBottom_toBottomOf="@+id/ll_tag_container"
         app:layout_constraintLeft_toRightOf="@+id/iv_good_tag"
         app:layout_constraintRight_toLeftOf="@+id/tv_author"
-        app:layout_constraintTop_toTopOf="@+id/tv_tag"
+        app:layout_constraintTop_toTopOf="@+id/ll_tag_container"
         tools:text="维瓦尔第 E第一维瓦尔第维瓦尔第维瓦尔第" />
 
     <TextView
@@ -55,8 +52,8 @@
         android:layout_marginEnd="25dp"
         android:ellipsize="end"
         android:includeFontPadding="false"
-        android:paddingStart="6dp"
         android:lines="1"
+        android:paddingStart="6dp"
         android:textColor="@color/color_999999"
         android:textSize="@dimen/sp_12"
         app:layout_constraintBottom_toBottomOf="@+id/tv_name"
@@ -86,15 +83,15 @@
         android:maxLines="1"
         android:textColor="@color/color_999999"
         android:textSize="@dimen/sp_12"
-        app:layout_constraintLeft_toLeftOf="@+id/tv_tag"
+        app:layout_constraintLeft_toLeftOf="@+id/ll_tag_container"
         app:layout_constraintTop_toBottomOf="@+id/tv_name"
         tools:text="上传者:一把剑走天涯" />
 
     <LinearLayout
-        android:layout_marginStart="12dp"
         android:id="@+id/ll_music_subject"
         android:layout_width="0dp"
         android:layout_height="wrap_content"
+        android:layout_marginStart="12dp"
         android:orientation="horizontal"
         app:layout_constraintBottom_toBottomOf="@+id/tv_upload_author"
         app:layout_constraintLeft_toRightOf="@+id/tv_upload_author"