فهرست منبع

安卓老师端新首页

Pq 3 سال پیش
والد
کامیت
80acc0a7a6
63فایلهای تغییر یافته به همراه1579 افزوده شده و 25 حذف شده
  1. 5 0
      BaseLibrary/src/main/res/drawable/shape_10dp_white.xml
  2. 5 0
      BaseLibrary/src/main/res/drawable/shape_effbf9_17dp.xml
  3. 5 0
      BaseLibrary/src/main/res/drawable/shape_effbf9_9dp.xml
  4. 4 0
      BaseLibrary/src/main/res/values/colors.xml
  5. 34 0
      teacher/src/main/java/com/cooleshow/teacher/adapter/HomeHotAlbumAdapter.java
  6. 49 0
      teacher/src/main/java/com/cooleshow/teacher/adapter/HomeHotMusicSheetAdapter.java
  7. 25 8
      teacher/src/main/java/com/cooleshow/teacher/api/APIService.java
  8. 79 0
      teacher/src/main/java/com/cooleshow/teacher/bean/HomeHotAlbumListBean.java
  9. 123 0
      teacher/src/main/java/com/cooleshow/teacher/bean/HomeHotMusicSheetBean.java
  10. 12 0
      teacher/src/main/java/com/cooleshow/teacher/bean/HomeHotMusicSheetItemBean.java
  11. 9 0
      teacher/src/main/java/com/cooleshow/teacher/contract/HomeContract.java
  12. 48 1
      teacher/src/main/java/com/cooleshow/teacher/presenter/main/HomePresenter.java
  13. 8 0
      teacher/src/main/java/com/cooleshow/teacher/ui/main/HomeFragment.kt
  14. 3 2
      teacher/src/main/java/com/cooleshow/teacher/ui/main/MainActivity.java
  15. 328 1
      teacher/src/main/java/com/cooleshow/teacher/ui/main/NewHomeFragment.java
  16. 35 0
      teacher/src/main/java/com/cooleshow/teacher/widgets/HomeHotMusicSheetItemDecoration.java
  17. 139 0
      teacher/src/main/java/com/cooleshow/teacher/widgets/HomeHotMusicSheetItemView.java
  18. BIN
      teacher/src/main/res/drawable-xhdpi/icon_album_badge_new_able.png
  19. BIN
      teacher/src/main/res/drawable-xhdpi/icon_album_badge_new_enable.png
  20. BIN
      teacher/src/main/res/drawable-xhdpi/icon_arrow_right_bg_tran.png
  21. BIN
      teacher/src/main/res/drawable-xhdpi/icon_arrow_right_white.png
  22. BIN
      teacher/src/main/res/drawable-xhdpi/icon_cert_complete.png
  23. BIN
      teacher/src/main/res/drawable-xhdpi/icon_home_cert_complete.png
  24. BIN
      teacher/src/main/res/drawable-xhdpi/icon_home_entry_doing.png
  25. BIN
      teacher/src/main/res/drawable-xhdpi/icon_home_star_tag.png
  26. BIN
      teacher/src/main/res/drawable-xhdpi/icon_home_un_certification.png
  27. BIN
      teacher/src/main/res/drawable-xhdpi/icon_hot_album_collect_num_tag.png
  28. BIN
      teacher/src/main/res/drawable-xhdpi/icon_live_badge_new_able.png
  29. BIN
      teacher/src/main/res/drawable-xhdpi/icon_live_badge_new_enable.png
  30. BIN
      teacher/src/main/res/drawable-xhdpi/icon_music_sheet_play.png
  31. BIN
      teacher/src/main/res/drawable-xhdpi/icon_next_right.png
  32. BIN
      teacher/src/main/res/drawable-xhdpi/icon_style_badge_new_able.png
  33. BIN
      teacher/src/main/res/drawable-xhdpi/icon_style_badge_new_enable.png
  34. BIN
      teacher/src/main/res/drawable-xhdpi/icon_top_message.png
  35. BIN
      teacher/src/main/res/drawable-xhdpi/icon_video_badge_new_able.png
  36. BIN
      teacher/src/main/res/drawable-xhdpi/icon_video_badge_new_enable.png
  37. BIN
      teacher/src/main/res/drawable-xxhdpi/icon_album_badge_new_able.png
  38. BIN
      teacher/src/main/res/drawable-xxhdpi/icon_album_badge_new_enable.png
  39. BIN
      teacher/src/main/res/drawable-xxhdpi/icon_arrow_right_bg_tran.png
  40. BIN
      teacher/src/main/res/drawable-xxhdpi/icon_arrow_right_white.png
  41. BIN
      teacher/src/main/res/drawable-xxhdpi/icon_cert_complete.png
  42. BIN
      teacher/src/main/res/drawable-xxhdpi/icon_home_cert_complete.png
  43. BIN
      teacher/src/main/res/drawable-xxhdpi/icon_home_entry_doing.png
  44. BIN
      teacher/src/main/res/drawable-xxhdpi/icon_home_star_tag.png
  45. BIN
      teacher/src/main/res/drawable-xxhdpi/icon_home_un_certification.png
  46. BIN
      teacher/src/main/res/drawable-xxhdpi/icon_hot_album_collect_num_tag.png
  47. BIN
      teacher/src/main/res/drawable-xxhdpi/icon_live_badge_new_able.png
  48. BIN
      teacher/src/main/res/drawable-xxhdpi/icon_live_badge_new_enable.png
  49. BIN
      teacher/src/main/res/drawable-xxhdpi/icon_music_sheet_play.png
  50. BIN
      teacher/src/main/res/drawable-xxhdpi/icon_next_right.png
  51. BIN
      teacher/src/main/res/drawable-xxhdpi/icon_style_badge_new_able.png
  52. BIN
      teacher/src/main/res/drawable-xxhdpi/icon_style_badge_new_enable.png
  53. BIN
      teacher/src/main/res/drawable-xxhdpi/icon_top_message.png
  54. BIN
      teacher/src/main/res/drawable-xxhdpi/icon_video_badge_new_able.png
  55. BIN
      teacher/src/main/res/drawable-xxhdpi/icon_video_badge_new_enable.png
  56. 6 0
      teacher/src/main/res/drawable/bg_434343_raduis.xml
  57. 7 0
      teacher/src/main/res/drawable/shape_01b84f_border.xml
  58. 7 0
      teacher/src/main/res/drawable/shape_3591ce_border.xml
  59. 7 0
      teacher/src/main/res/drawable/shape_cd863e_border.xml
  60. 471 13
      teacher/src/main/res/layout/fragment_new_home_layout.xml
  61. 9 0
      teacher/src/main/res/layout/item_home_hot_music_sheet_layout.xml
  62. 62 0
      teacher/src/main/res/layout/layout_home_hot_album_item.xml
  63. 99 0
      teacher/src/main/res/layout/view_hot_music_sheet_child_layout.xml

+ 5 - 0
BaseLibrary/src/main/res/drawable/shape_10dp_white.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="@color/white" />
+    <corners android:radius="10dp" />
+</shape>

+ 5 - 0
BaseLibrary/src/main/res/drawable/shape_effbf9_17dp.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="#EFFBF9"/>
+    <corners android:radius="17dp"/>
+</shape>

+ 5 - 0
BaseLibrary/src/main/res/drawable/shape_effbf9_9dp.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="#EFFBF9"/>
+    <corners android:radius="9dp"/>
+</shape>

+ 4 - 0
BaseLibrary/src/main/res/values/colors.xml

@@ -107,6 +107,10 @@
     <color name="color_a7fcf2">#A7FCF2</color>
     <color name="color_69eed5">#69EED5</color>
     <color name="color_00876e">#00876E</color>
+    <color name="color_e8e8e8">#E8E8E8</color>
+    <color name="color_01b84f">#01B84F</color>
+    <color name="color_cd863e">#CD863E</color>
+    <color name="color_3591ce">#3591ce</color>
 
     <color name="color_25292e">#25292E</color>
     <color name="color_F8F8F8">#F8F8F8</color>

+ 34 - 0
teacher/src/main/java/com/cooleshow/teacher/adapter/HomeHotAlbumAdapter.java

@@ -0,0 +1,34 @@
+package com.cooleshow.teacher.adapter;
+
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.chad.library.adapter.base.BaseQuickAdapter;
+import com.chad.library.adapter.base.viewholder.BaseViewHolder;
+import com.cooleshow.base.utils.GlideUtils;
+import com.cooleshow.teacher.R;
+import com.cooleshow.teacher.bean.HomeHotAlbumListBean;
+
+import java.util.List;
+
+/**
+ * 创建日期:2022/5/27 11:51
+ *
+ * @author Ryan
+ * 类说明:
+ */
+public class HomeHotAlbumAdapter extends BaseQuickAdapter<HomeHotAlbumListBean.RowsBean, BaseViewHolder> {
+
+    public HomeHotAlbumAdapter() {
+        super(R.layout.layout_home_hot_album_item);
+    }
+
+    @Override
+    protected void convert(BaseViewHolder helper, HomeHotAlbumListBean.RowsBean item) {
+        ImageView im_pic = helper.getView(R.id.im_pic);
+        GlideUtils.INSTANCE.loadImage(getContext(), item.albumCoverUrl, im_pic);
+        TextView tv_collect_num = helper.getView(R.id.tv_collect_num);
+        tv_collect_num.setText(String.format("%d人", item.albumFavoriteCount));
+        helper.setText(R.id.album_name, item.albumName);
+    }
+}

+ 49 - 0
teacher/src/main/java/com/cooleshow/teacher/adapter/HomeHotMusicSheetAdapter.java

@@ -0,0 +1,49 @@
+package com.cooleshow.teacher.adapter;
+
+import android.view.ViewGroup;
+import android.widget.LinearLayout;
+
+import com.chad.library.adapter.base.BaseQuickAdapter;
+import com.cooleshow.base.utils.ScreenUtils;
+import com.cooleshow.teacher.R;
+import com.cooleshow.teacher.bean.HomeHotMusicSheetBean;
+import com.cooleshow.teacher.bean.HomeHotMusicSheetItemBean;
+import com.chad.library.adapter.base.viewholder.BaseViewHolder;
+import com.cooleshow.teacher.widgets.HomeHotMusicSheetItemView;
+
+import androidx.annotation.NonNull;
+
+/**
+ * Author by pq, Date on 2022/8/8.
+ */
+public class HomeHotMusicSheetAdapter extends BaseQuickAdapter<HomeHotMusicSheetItemBean, BaseViewHolder> {
+    private int maxWidth = 0;
+
+    public HomeHotMusicSheetAdapter() {
+        super(R.layout.item_home_hot_music_sheet_layout);
+        int screenWidth = ScreenUtils.getScreenWidth();
+        maxWidth = (int) (screenWidth * 0.83);
+    }
+
+    @Override
+    protected void convert(@NonNull BaseViewHolder holder, HomeHotMusicSheetItemBean homeHotMusicSheetItemBean) {
+        LinearLayout ll_container = holder.getView(R.id.ll_container);
+        ViewGroup.LayoutParams layoutParams = ll_container.getLayoutParams();
+        layoutParams.width = maxWidth;
+        ll_container.setLayoutParams(layoutParams);
+        ll_container.removeAllViews();
+        if (homeHotMusicSheetItemBean.sheetBeans != null && homeHotMusicSheetItemBean.sheetBeans.size() > 0) {
+            for (int i = 0; i < homeHotMusicSheetItemBean.sheetBeans.size(); i++) {
+                HomeHotMusicSheetBean.RowsBean homeHotMusicSheetBean = homeHotMusicSheetItemBean.sheetBeans.get(i);
+                HomeHotMusicSheetItemView hotMusicSheetItemView = new HomeHotMusicSheetItemView(getContext());
+                hotMusicSheetItemView.setData(homeHotMusicSheetBean);
+                if (i != homeHotMusicSheetItemBean.sheetBeans.size() - 1) {
+                    hotMusicSheetItemView.setDividingLineIsShow(true);
+                } else {
+                    hotMusicSheetItemView.setDividingLineIsShow(false);
+                }
+                ll_container.addView(hotMusicSheetItemView);
+            }
+        }
+    }
+}

+ 25 - 8
teacher/src/main/java/com/cooleshow/teacher/api/APIService.java

@@ -2,6 +2,8 @@ package com.cooleshow.teacher.api;
 
 import com.common.im.bean.ContactRoomListBean;
 import com.cooleshow.base.data.net.BaseResponse;
+import com.cooleshow.teacher.bean.HomeHotAlbumListBean;
+import com.cooleshow.teacher.bean.HomeHotMusicSheetBean;
 import com.cooleshow.teacher.bean.HomeLiveAndVideoBean;
 import com.cooleshow.teacher.bean.HomeMenuBean;
 import com.cooleshow.teacher.bean.LiveListBean;
@@ -12,7 +14,6 @@ import com.cooleshow.teacher.bean.request.CommentHomeWorkEntry;
 import com.cooleshow.teacher.bean.request.LiveCourseEntry;
 import com.cooleshow.teacher.bean.AccountDetailBean;
 import com.cooleshow.teacher.bean.AccountTotalBean;
-import com.cooleshow.base.bean.AddressBean;
 import com.cooleshow.teacher.bean.CountOfUnreadBean;
 import com.cooleshow.teacher.bean.CourseCommentListBean;
 import com.cooleshow.teacher.bean.CourseTableDataBean;
@@ -74,7 +75,6 @@ import retrofit2.http.Url;
 
 import static com.cooleshow.base.common.BaseConstant.AUTH_GROUP;
 import static com.cooleshow.base.common.BaseConstant.CMS_SERVER;
-import static com.cooleshow.base.common.BaseConstant.MALL_PORTAL_SERVER;
 import static com.cooleshow.base.common.BaseConstant.STUDENT_GROUP;
 import static com.cooleshow.base.common.BaseConstant.TEACHER_GROUP;
 
@@ -274,7 +274,7 @@ public interface APIService {
     @GET(TEACHER_GROUP + "teacher/queryUserInfo")
     Observable<BaseResponse<TeacherUserInfo>> getTeacherUserInfo();
 
-     /**
+    /**
      * 查询老师个人信息
      *
      * @param
@@ -395,18 +395,19 @@ public interface APIService {
     /**
      * 发送登录短信验证码
      *
-     * @param body mobile 手机号
+     * @param  mobile 手机号
      *             type:类型(PASSWD:修改密码,LOGIN:登录或注册,BANK:绑定银行卡,PHONE:修改手机号)
      * @return
      */
     @FormUrlEncoded
     @POST(TEACHER_GROUP + "code/sendSmsCode")
-    Observable<BaseResponse<Object>> sendSmsCode(@FieldMap Map<String,String> map);
+    Observable<BaseResponse<Object>> sendSmsCode(@FieldMap Map<String, String> map);
 
     /**
      * 校验图片验证码
+     * <p>
+     * type:类型(PASSWD:修改密码,LOGIN:登录或注册,BANK:绑定银行卡,PHONE:修改手机号)
      *
-     *             type:类型(PASSWD:修改密码,LOGIN:登录或注册,BANK:绑定银行卡,PHONE:修改手机号)
      * @return
      */
     @FormUrlEncoded
@@ -435,7 +436,7 @@ public interface APIService {
     /**
      * 意见反馈
      *
-     * @param body
+     * @param
      * @return
      */
     @FormUrlEncoded
@@ -669,7 +670,7 @@ public interface APIService {
      * @return
      */
     @GET(TEACHER_GROUP + "liveRoomVideo/queryVideo")
-    Observable<BaseResponse<ArrayList<LivePlayBackDataBean>>> getLivePlaybackData(@Query("roomUid") String  roomUid);
+    Observable<BaseResponse<ArrayList<LivePlayBackDataBean>>> getLivePlaybackData(@Query("roomUid") String roomUid);
 
 
     /**
@@ -738,4 +739,20 @@ public interface APIService {
      */
     @POST(CMS_SERVER + "news/app/home")
     Observable<BaseResponse<HomeMenuBean>> appHome(@Body RequestBody body);
+
+    /**
+     * app首页热门专辑
+     *
+     * @return
+     */
+    @POST(TEACHER_GROUP + "music/album/list")
+    Observable<BaseResponse<HomeHotAlbumListBean>> getHotAlbumList(@Body RequestBody body);
+
+    /**
+     * app首页热门专辑
+     *
+     * @return
+     */
+    @POST(TEACHER_GROUP + "music/sheet/list")
+    Observable<BaseResponse<HomeHotMusicSheetBean>> getHotMusicSheetList(@Body RequestBody body);
 }

+ 79 - 0
teacher/src/main/java/com/cooleshow/teacher/bean/HomeHotAlbumListBean.java

@@ -0,0 +1,79 @@
+package com.cooleshow.teacher.bean;
+
+import java.util.List;
+
+/**
+ * Author by pq, Date on 2022/8/8.
+ */
+public class HomeHotAlbumListBean {
+
+    /**
+     * footer : [{"albumCoverUrl":"","albumDesc":"","albumFavoriteCount":0,"albumName":"","albumStatus":"","albumTag":"","auditVersion":"","createBy":0,"createTime":"","delFlag":true,"favorite":"","hotFlag":"","id":0,"musicSheetCount":0,"musicTagNames":"","sortNumber":0,"subjectId":"","subjectNames":"","topFlag":"","updateBy":0,"updateTime":""}]
+     * limit : 0
+     * nextPage : 0
+     * offset : 0
+     * pageNo : 0
+     * prePage : 0
+     * rows : [{"albumCoverUrl":"","albumDesc":"","albumFavoriteCount":0,"albumName":"","albumStatus":"","albumTag":"","auditVersion":"","createBy":0,"createTime":"","delFlag":true,"favorite":"","hotFlag":"","id":0,"musicSheetCount":0,"musicTagNames":"","sortNumber":0,"subjectId":"","subjectNames":"","topFlag":"","updateBy":0,"updateTime":""}]
+     * statInfo : {}
+     * total : 0
+     * totalPage : 0
+     */
+
+    public int limit;
+    public int nextPage;
+    public int offset;
+    public int pageNo;
+    public int prePage;
+    public int total;
+    public int totalPage;
+    public List<RowsBean> rows;
+
+    public static class RowsBean {
+        /**
+         * albumCoverUrl :
+         * albumDesc :
+         * albumFavoriteCount : 0
+         * albumName :
+         * albumStatus :
+         * albumTag :
+         * auditVersion :
+         * createBy : 0
+         * createTime :
+         * delFlag : true
+         * favorite :
+         * hotFlag :
+         * id : 0
+         * musicSheetCount : 0
+         * musicTagNames :
+         * sortNumber : 0
+         * subjectId :
+         * subjectNames :
+         * topFlag :
+         * updateBy : 0
+         * updateTime :
+         */
+
+        public String albumCoverUrl;
+        public String albumDesc;
+        public int albumFavoriteCount;
+        public String albumName;
+        public String albumStatus;
+        public String albumTag;
+        public String auditVersion;
+        public int createBy;
+        public String createTime;
+        public boolean delFlag;
+        public String favorite;
+        public String hotFlag;
+        public int id;
+        public int musicSheetCount;
+        public String musicTagNames;
+        public int sortNumber;
+        public String subjectId;
+        public String subjectNames;
+        public String topFlag;
+        public int updateBy;
+        public String updateTime;
+    }
+}

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

@@ -0,0 +1,123 @@
+package com.cooleshow.teacher.bean;
+
+import java.util.List;
+
+/**
+ * Author by pq, Date on 2022/8/8.
+ */
+public class HomeHotMusicSheetBean {
+
+    /**
+     * footer : [{"addName":"","addUserAvatar":"","audioFileUrl":"","audioType":"","auditStatus":"","auditVersion":"","canEvaluate":"","chargeType":"","composer":"","createBy":0,"createTime":"","delFlag":true,"extConfigJson":"","favorite":"","favoriteCount":0,"hasBeat":"","hotFlag":"","id":0,"metronomeUrl":"","midiUrl":"","mp3Type":"","musicPrice":0,"musicSheetName":"","musicSubject":"","musicTag":"","musicTagNames":"","notation":"","play":"","playSpeed":0,"reason":"","remark":"","showFingering":"","sortNumber":0,"sourceType":"","state":"","subjectNames":"","submitAuditTime":"","topFlag":"","updateBy":0,"updateTime":"","url":"","userId":0,"xmlFileUrl":""}]
+     * limit : 0
+     * nextPage : 0
+     * offset : 0
+     * pageNo : 0
+     * prePage : 0
+     * rows : [{"addName":"","addUserAvatar":"","audioFileUrl":"","audioType":"","auditStatus":"","auditVersion":"","canEvaluate":"","chargeType":"","composer":"","createBy":0,"createTime":"","delFlag":true,"extConfigJson":"","favorite":"","favoriteCount":0,"hasBeat":"","hotFlag":"","id":0,"metronomeUrl":"","midiUrl":"","mp3Type":"","musicPrice":0,"musicSheetName":"","musicSubject":"","musicTag":"","musicTagNames":"","notation":"","play":"","playSpeed":0,"reason":"","remark":"","showFingering":"","sortNumber":0,"sourceType":"","state":"","subjectNames":"","submitAuditTime":"","topFlag":"","updateBy":0,"updateTime":"","url":"","userId":0,"xmlFileUrl":""}]
+     * statInfo : {}
+     * total : 0
+     * totalPage : 0
+     */
+
+    public int limit;
+    public int nextPage;
+    public int offset;
+    public int pageNo;
+    public int prePage;
+    public int total;
+    public int totalPage;
+    public List<RowsBean> rows;
+
+    public static class RowsBean {
+        /**
+         * addName :
+         * addUserAvatar :
+         * audioFileUrl :
+         * audioType :
+         * auditStatus :
+         * auditVersion :
+         * canEvaluate :
+         * chargeType :
+         * composer :
+         * createBy : 0
+         * createTime :
+         * delFlag : true
+         * extConfigJson :
+         * favorite :
+         * favoriteCount : 0
+         * hasBeat :
+         * hotFlag :
+         * id : 0
+         * metronomeUrl :
+         * midiUrl :
+         * mp3Type :
+         * musicPrice : 0
+         * musicSheetName :
+         * musicSubject :
+         * musicTag :
+         * musicTagNames :
+         * notation :
+         * play :
+         * playSpeed : 0
+         * reason :
+         * remark :
+         * showFingering :
+         * sortNumber : 0
+         * sourceType :
+         * state :
+         * subjectNames :
+         * submitAuditTime :
+         * topFlag :
+         * updateBy : 0
+         * updateTime :
+         * url :
+         * userId : 0
+         * xmlFileUrl :
+         */
+
+        public String addName;
+        public String addUserAvatar;
+        public String audioFileUrl;
+        public String audioType;
+        public String auditStatus;
+        public String auditVersion;
+        public String canEvaluate;
+        public String chargeType;
+        public String composer;
+        public int createBy;
+        public String createTime;
+        public boolean delFlag;
+        public String extConfigJson;
+        public String favorite;
+        public int favoriteCount;
+        public String hasBeat;
+        public String hotFlag;
+        public int id;
+        public String metronomeUrl;
+        public String midiUrl;
+        public String mp3Type;
+        public String musicPrice;
+        public String musicSheetName;
+        public String musicSubject;
+        public String musicTag;
+        public String musicTagNames;
+        public String notation;
+        public String play;
+        public int playSpeed;
+        public String reason;
+        public String remark;
+        public String showFingering;
+        public int sortNumber;
+        public String sourceType;
+        public String state;
+        public String subjectNames;
+        public String submitAuditTime;
+        public String topFlag;
+        public int updateBy;
+        public String updateTime;
+        public String url;
+        public int userId;
+        public String xmlFileUrl;
+    }
+}

+ 12 - 0
teacher/src/main/java/com/cooleshow/teacher/bean/HomeHotMusicSheetItemBean.java

@@ -0,0 +1,12 @@
+package com.cooleshow.teacher.bean;
+
+import java.lang.reflect.Array;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Author by pq, Date on 2022/8/8.
+ */
+public class HomeHotMusicSheetItemBean {
+    public ArrayList<HomeHotMusicSheetBean.RowsBean> sheetBeans =new ArrayList<>();
+}

+ 9 - 0
teacher/src/main/java/com/cooleshow/teacher/contract/HomeContract.java

@@ -4,6 +4,8 @@ import com.cooleshow.base.presenter.view.BaseView;
 import com.cooleshow.teacher.bean.CountOfUnreadBean;
 import com.cooleshow.teacher.bean.HelpCenterContentBean;
 import com.cooleshow.teacher.bean.HomeCountBean;
+import com.cooleshow.teacher.bean.HomeHotAlbumListBean;
+import com.cooleshow.teacher.bean.HomeHotMusicSheetBean;
 import com.cooleshow.teacher.bean.HomeLiveAndVideoBean;
 import com.cooleshow.teacher.bean.HomeMenuBean;
 import com.cooleshow.teacher.bean.TeacherUserInfo;
@@ -18,11 +20,18 @@ public interface HomeContract {
 
     interface HomeView extends BaseView {
         void getHomeCountSuccess(HomeCountBean data);
+
         void helpCenterContentListSuccess(HelpCenterContentBean data);
+
         void queryCountOfUnreadSuccess(List<CountOfUnreadBean> data);
+
         void queryLiveAndVideoSuccess(HomeLiveAndVideoBean bean);
 
         void appHomeSuccess(HomeMenuBean homeMenuBean);
+
+        void getHotAlbumListSuccess(HomeHotAlbumListBean homeHotAlbumListBean);
+
+        void getHotMusicSheetListSuccess(HomeHotMusicSheetBean homeHotMusicSheetBean);
     }
 
     interface Presenter {

+ 48 - 1
teacher/src/main/java/com/cooleshow/teacher/presenter/main/HomePresenter.java

@@ -8,6 +8,8 @@ import com.cooleshow.teacher.api.APIService;
 import com.cooleshow.teacher.bean.CountOfUnreadBean;
 import com.cooleshow.teacher.bean.HelpCenterContentBean;
 import com.cooleshow.teacher.bean.HomeCountBean;
+import com.cooleshow.teacher.bean.HomeHotAlbumListBean;
+import com.cooleshow.teacher.bean.HomeHotMusicSheetBean;
 import com.cooleshow.teacher.bean.HomeLiveAndVideoBean;
 import com.cooleshow.teacher.bean.HomeMenuBean;
 import com.cooleshow.teacher.bean.TeacherUserInfo;
@@ -23,7 +25,6 @@ import java.util.List;
  * Author by pq, Date on 2022/4/20.
  */
 public class HomePresenter extends BasePresenter<HomeContract.HomeView> implements HomeContract.Presenter {
-
     /**
      * 查询UserInfo
      *
@@ -173,4 +174,50 @@ public class HomePresenter extends BasePresenter<HomeContract.HomeView> implemen
             }
         });
     }
+
+    /**
+     * 获取热门专辑
+     */
+    public void getHotAlbumList() {
+        if (getView() != null) {
+            getView().showLoading();
+        }
+        JSONObject jsonObject = new JSONObject();
+        try {
+            jsonObject.putOpt("albumStatus", "YES");
+        } catch (JSONException e) {
+            e.printStackTrace();
+        }
+        addSubscribe(create(APIService.class).getHotAlbumList(RequestBodyUtil.convertToRequestBodyJson(jsonObject.toString())), new BaseObserver<HomeHotAlbumListBean>(getView()) {
+            @Override
+            protected void onSuccess(HomeHotAlbumListBean data) {
+                if (null != getView()) {
+                    getView().getHotAlbumListSuccess(data);
+                }
+            }
+        });
+    }
+
+    /**
+     * 获取热门曲目
+     */
+    public void getHotMusicSheetList(){
+        if (getView() != null) {
+            getView().showLoading();
+        }
+        JSONObject jsonObject = new JSONObject();
+        try {
+            jsonObject.putOpt("myself", false);
+        } catch (JSONException e) {
+            e.printStackTrace();
+        }
+        addSubscribe(create(APIService.class).getHotMusicSheetList(RequestBodyUtil.convertToRequestBodyJson(jsonObject.toString())), new BaseObserver<HomeHotMusicSheetBean>(getView()) {
+            @Override
+            protected void onSuccess(HomeHotMusicSheetBean data) {
+                if (null != getView()) {
+                    getView().getHotMusicSheetListSuccess(data);
+                }
+            }
+        });
+    }
 }

+ 8 - 0
teacher/src/main/java/com/cooleshow/teacher/ui/main/HomeFragment.kt

@@ -428,6 +428,14 @@ class HomeFragment : BaseMVPFragment<FragmentHomeLayoutBinding, HomePresenter>()
         }
     }
 
+    override fun getHotAlbumListSuccess(homeHotAlbumListBean: HomeHotAlbumListBean?) {
+        TODO("Not yet implemented")
+    }
+
+    override fun getHotMusicSheetListSuccess(homeHotMusicSheetBean: HomeHotMusicSheetBean?) {
+        TODO("Not yet implemented")
+    }
+
     /**
      * 跳转直播课详情页面
      *

+ 3 - 2
teacher/src/main/java/com/cooleshow/teacher/ui/main/MainActivity.java

@@ -78,7 +78,7 @@ import static com.cooleshow.base.constanst.Constants.MAIN_PAGE_SELECT_POTION_KEY
 @Route(path = RouterPath.APPCenter.PATH_HOME)
 public class MainActivity extends BaseMVPActivity<ActivityMainBinding, MainPresenter> implements MainContract.MainView, UnReadMessageManager.IUnReadMessageObserver {
     private ArrayList<Fragment> mFragments = new ArrayList<>();
-    private HomeFragment mHomeFragment;
+    private NewHomeFragment mHomeFragment;
     private MineFragment mMineFragment;
     private MallFragment shopMallFragment;
     private TextView tvMsgCount;
@@ -155,11 +155,12 @@ public class MainActivity extends BaseMVPActivity<ActivityMainBinding, MainPrese
         onTabClick(viewBinding.viewHome);
         tvMsgCount = viewBinding.tvMsgCount;
         HomePageAdapter homePageAdapter = new HomePageAdapter(this);
-        mHomeFragment = new HomeFragment();
+//        mHomeFragment = new HomeFragment();
         CourseTableFragment courseTableFragment = new CourseTableFragment();
         MessageFragment messageFragment = new MessageFragment();
         shopMallFragment = new MallFragment();
         mMineFragment = new MineFragment();
+        mHomeFragment =new NewHomeFragment();
         mFragments.add(mHomeFragment);
         mFragments.add(courseTableFragment);
         mFragments.add(messageFragment);

+ 328 - 1
teacher/src/main/java/com/cooleshow/teacher/ui/main/NewHomeFragment.java

@@ -1,16 +1,59 @@
 package com.cooleshow.teacher.ui.main;
 
+import android.text.TextUtils;
 import android.view.View;
 
+import com.alibaba.android.arouter.launcher.ARouter;
+import com.cooleshow.base.common.WebConstants;
+import com.cooleshow.base.router.RouterPath;
 import com.cooleshow.base.ui.fragment.BaseMVPFragment;
+import com.cooleshow.base.utils.LogUtils;
+import com.cooleshow.base.utils.SizeUtils;
+import com.cooleshow.base.utils.TimeUtils;
+import com.cooleshow.base.utils.UiUtils;
 import com.cooleshow.base.utils.Utils;
+import com.cooleshow.teacher.R;
+import com.cooleshow.teacher.adapter.HomeHotAlbumAdapter;
+import com.cooleshow.teacher.adapter.HomeHotMusicSheetAdapter;
+import com.cooleshow.teacher.adapter.HomeMenuPageAdapter;
+import com.cooleshow.teacher.bean.CountOfUnreadBean;
+import com.cooleshow.teacher.bean.HelpCenterContentBean;
+import com.cooleshow.teacher.bean.HomeCountBean;
+import com.cooleshow.teacher.bean.HomeHotAlbumListBean;
+import com.cooleshow.teacher.bean.HomeHotMusicSheetBean;
+import com.cooleshow.teacher.bean.HomeHotMusicSheetItemBean;
+import com.cooleshow.teacher.bean.HomeLiveAndVideoBean;
+import com.cooleshow.teacher.bean.HomeMenuBean;
+import com.cooleshow.teacher.bean.TeacherUserInfo;
+import com.cooleshow.teacher.constants.CourseConstants;
+import com.cooleshow.teacher.constants.TeacherInfoConstants;
+import com.cooleshow.teacher.contract.HomeContract;
 import com.cooleshow.teacher.databinding.FragmentNewHomeLayoutBinding;
 import com.cooleshow.teacher.presenter.main.HomePresenter;
+import com.cooleshow.teacher.widgets.HomeHotMusicSheetItemDecoration;
+import com.cooleshow.usercenter.helper.UserHelper;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import androidx.fragment.app.Fragment;
+import androidx.recyclerview.widget.LinearLayoutManager;
 
 /**
  * Author by pq, Date on 2022/8/8.
  */
-public class NewHomeFragment extends BaseMVPFragment<FragmentNewHomeLayoutBinding, HomePresenter> {
+public class NewHomeFragment extends BaseMVPFragment<FragmentNewHomeLayoutBinding, HomePresenter> implements HomeContract.HomeView, View.OnClickListener {
+    public static final String STYLE_TYPE = "STYLE";
+    public static final String VIDEON_TYPE = "VIDEO";
+    public static final String LIVE_TYPE = "LIVE";
+    public static final String MUSIC_TYPE = "MUSIC";
+    private long noticeId = 0;
+    private HomeLiveAndVideoBean.RecentCoursesBean mRecentCourses;
+    private ArrayList<Fragment> fragments = new ArrayList();
+    private HomeMenuPageAdapter menuAdapter;
+    private HomeHotAlbumAdapter mAlbumAdapter;
+    private HomeHotMusicSheetAdapter mHomeHotMusicSheetAdapter;
 
     @Override
     protected void initView(View rootView) {
@@ -19,7 +62,278 @@ public class NewHomeFragment extends BaseMVPFragment<FragmentNewHomeLayoutBindin
 
     @Override
     protected void initData() {
+        initListener();
+        initMenu();
+        LinearLayoutManager manager = new LinearLayoutManager(getContext());
+        manager.setOrientation(LinearLayoutManager.HORIZONTAL);
+        mViewBinding.rvHotAlbum.setLayoutManager(manager);
+        mAlbumAdapter = new HomeHotAlbumAdapter();
+        mViewBinding.rvHotAlbum.setAdapter(mAlbumAdapter);
+
+        LinearLayoutManager musicSheetManager = new LinearLayoutManager(getContext());
+        musicSheetManager.setOrientation(LinearLayoutManager.HORIZONTAL);
+        mHomeHotMusicSheetAdapter = new HomeHotMusicSheetAdapter();
+        HomeHotMusicSheetItemDecoration itemDecoration = new HomeHotMusicSheetItemDecoration(0, SizeUtils.dp2px(12), 0, SizeUtils.dp2px(12), 0);
+        mViewBinding.rvHotTrack.addItemDecoration(itemDecoration);
+        mViewBinding.rvHotTrack.setLayoutManager(musicSheetManager);
+        mViewBinding.rvHotTrack.setAdapter(mHomeHotMusicSheetAdapter);
+
+        presenter.getHotAlbumList();
+        presenter.getHotMusicSheetList();
+    }
+
+
+    private void initMenu() {
+        if (menuAdapter == null) {
+            menuAdapter = new HomeMenuPageAdapter(getChildFragmentManager());
+            menuAdapter.setFragments(fragments);
+        }
+        mViewBinding.viewpagerMenu.setAdapter(menuAdapter);
+    }
+
+    private void initListener() {
+        mViewBinding.flCourseEnter.setOnClickListener(this);
+    }
+
+    @Override
+    public void onResume() {
+        super.onResume();
+        if (presenter != null) {
+            presenter.queryCountOfUnread();
+            presenter.helpCenterContentList();
+            presenter.queryLiveAndVideo();
+            presenter.appHome();
+        }
+    }
+
+    @Override
+    public void getHomeCountSuccess(HomeCountBean data) {
+
+    }
+
+    @Override
+    public void helpCenterContentListSuccess(HelpCenterContentBean data) {
+        if (data != null && data.rows != null && data.rows.size() > 0) {
+            mViewBinding.bgAnnouncement.setVisibility(View.VISIBLE);
+            mViewBinding.tvNoticeContent.setText(data.rows.get(0).title);
+            noticeId = data.rows.get(0).id;
+        } else {
+            mViewBinding.bgAnnouncement.setVisibility(View.GONE);
+        }
+
+    }
+
+
+    @Override
+    public void queryCountOfUnreadSuccess(List<CountOfUnreadBean> data) {
+        if (data != null && data.size() > 0) {
+            mViewBinding.viewUnreadMessage.setVisibility(View.VISIBLE);
+        } else {
+            mViewBinding.viewUnreadMessage.setVisibility(View.GONE);
+        }
+    }
 
+    @Override
+    public void queryLiveAndVideoSuccess(HomeLiveAndVideoBean bean) {
+        if (bean == null) {
+            return;
+        }
+        mRecentCourses = bean.recentCourses;
+        mViewBinding.flCourseEnter.setVisibility(mRecentCourses != null ? View.VISIBLE : View.GONE);
+        if (mRecentCourses != null) {
+            mViewBinding.tvLiveTitle.setText(mRecentCourses.courseGroupName + "即将开始");
+            String currentTime = TimeUtils.date2String(new Date(System.currentTimeMillis()), "yyyy-MM-dd");
+            String startTime = TimeUtils.date2String(
+                    TimeUtils.getDate(mRecentCourses.courseStartTime),
+                    "yyyy-MM-dd"
+            );
+            if (TextUtils.equals(currentTime, startTime)) {
+                String timeText =
+                        TimeUtils.date2String(TimeUtils.getDate(mRecentCourses.courseStartTime), "HH:mm");
+                mViewBinding.tvLiveTime.setText(String.format("今日 %s", timeText));
+            } else {
+                mViewBinding.tvLiveTime.setText(TimeUtils.date2String(
+                        TimeUtils.getDate(mRecentCourses.courseStartTime),
+                        "yyyy-MM-dd HH:mm"
+                ));
+            }
+        }
+    }
+
+    /**
+     * 跳转直播课详情页面
+     *
+     * @param
+     */
+    private void gotoCourseDetail(HomeLiveAndVideoBean.RecentCoursesBean bean) {
+        if (bean == null) {
+            return;
+        }
+
+        if (TextUtils.equals(bean.courseType, CourseConstants.LIVE_COURSE)) {
+            ARouter.getInstance()
+                    .build(RouterPath.WebCenter.ACTIVITY_HTML)
+                    .withString(
+                            WebConstants.WEB_URL,
+                            String.format(
+                                    WebConstants.TEACHER_LIVE_DETAIL_NORMAL_COURSE,
+                                    bean.courseGroupId,
+                                    bean.courseId
+                            )
+                    )
+                    .navigation();
+            return;
+        }
+        if (TextUtils.equals(bean.courseType, CourseConstants.OTHER_COURSE)) {
+            //陪练课
+            ARouter.getInstance().build(RouterPath.CourseCenter.SPARRING_COURSE_DETAIL)
+                    .withString(CourseConstants.COURSE_ID, String.valueOf(bean.courseId))
+                    .withString(CourseConstants.COURSE_GROUP_ID, String.valueOf(bean.courseGroupId))
+                    .withString(CourseConstants.STUDENT_ID, bean.studentId.toString())
+                    .navigation();
+            return;
+        }
+
+        if (TextUtils.equals(bean.courseType, CourseConstants.PIANO_ROOM_COURSE)) {
+            //琴房课 跳转详情页
+            ARouter.getInstance().build(RouterPath.CourseCenter.PIANO_ROOM_COURSE_DETAIL)
+                    .withString(CourseConstants.COURSE_ID, String.valueOf(bean.courseId))
+                    .navigation();
+            return;
+        }
+    }
+
+    @Override
+    public void appHomeSuccess(HomeMenuBean homeMenuBean) {
+        if (isDetached()) {
+            return;
+        }
+        if (homeMenuBean != null && homeMenuBean.appMenu != null && homeMenuBean.appMenu.size() > 0) {
+            mViewBinding.flTopMenu.setVisibility(View.VISIBLE);
+            fragments.clear();
+            int count = homeMenuBean.appMenu.size() / 4;
+            if (homeMenuBean.appMenu.size() % 4 > 0) {
+                count++;
+            }
+
+            for (int i = 0; i < count; i++) {
+                ArrayList<HomeMenuBean.ItemBean> dataList = new ArrayList<HomeMenuBean.ItemBean>();
+                int j = i * 4;
+                while (j < homeMenuBean.appMenu.size() && j < (i + 1) * 4) {
+                    dataList.add(homeMenuBean.appMenu.get(j));
+                    j++;
+                }
+                fragments.add(HomeMenuFragment.newInstance(dataList));
+            }
+            menuAdapter.setFragments(fragments);
+            menuAdapter.notifyDataSetChanged();
+        } else {
+            fragments.clear();
+            menuAdapter.notifyDataSetChanged();
+            mViewBinding.flTopMenu.setVisibility(View.GONE);
+        }
+    }
+
+    @Override
+    public void getHotAlbumListSuccess(HomeHotAlbumListBean homeHotAlbumListBean) {
+        if (isDetached() || homeHotAlbumListBean == null || homeHotAlbumListBean.rows == null) {
+            return;
+        }
+        if (mAlbumAdapter != null) {
+            mAlbumAdapter.setNewInstance(homeHotAlbumListBean.rows);
+        }
+    }
+
+    @Override
+    public void getHotMusicSheetListSuccess(HomeHotMusicSheetBean homeHotMusicSheetBean) {
+        if (isDetached() || homeHotMusicSheetBean == null || homeHotMusicSheetBean.rows == null) {
+            return;
+        }
+        ArrayList<HomeHotMusicSheetItemBean> itemBeans = new ArrayList<>();
+        List<HomeHotMusicSheetBean.RowsBean> rows = homeHotMusicSheetBean.rows;
+        if (rows != null && rows.size() > 0) {
+            int pageCount = 0;
+            int pageResult = rows.size() % 4;
+            if (pageResult == 0) {
+                pageCount = rows.size() / 4;
+            } else {
+                pageCount = (rows.size() / 4) + 1;
+            }
+            LogUtils.i("pq", "rows:" + rows.size());
+            LogUtils.i("pq", "pageCount:" + pageCount);
+            for (int i = 0; i < pageCount; i++) {
+                HomeHotMusicSheetItemBean hotMusicSheetItemBean = new HomeHotMusicSheetItemBean();
+                for (int k = i * 4; k < rows.size() && k < (i + 1) * 4; k++) {
+                    hotMusicSheetItemBean.sheetBeans.add(rows.get(k));
+                }
+                itemBeans.add(hotMusicSheetItemBean);
+            }
+            if (mHomeHotMusicSheetAdapter != null) {
+                mHomeHotMusicSheetAdapter.setNewInstance(itemBeans);
+            }
+        }
+    }
+
+    public void getTeacherInfoSuccess(TeacherUserInfo teacherUserInfo) {
+        //昵称
+        if (teacherUserInfo != null) {
+            mViewBinding.tvTeacherName.setText(String.format("你好,%s", UserHelper.getTeacherName(teacherUserInfo.username, teacherUserInfo.userId)));
+        }
+        //星级
+        if (teacherUserInfo.starGrade > 0) {
+            mViewBinding.ratingBar.setVisibility(View.VISIBLE);
+            mViewBinding.ratingBar.setRating(teacherUserInfo.starGrade);
+        } else {
+            mViewBinding.ratingBar.setVisibility(View.VISIBLE);
+        }
+        //徽章
+        handleBadgeUI(teacherUserInfo.tag);
+        //VIP
+        mViewBinding.ivVip.setImageResource(teacherUserInfo.isVip == 0 ? com.cooleshow.base.R.drawable.icon_vip_enable : com.cooleshow.base.R.drawable.icon_vip_able);
+        //入驻状态
+        if (TextUtils.equals(teacherUserInfo.entryStatus, TeacherInfoConstants.ENTRY_STATUS_DOING)) {
+            //入驻审核中
+            mViewBinding.ivCert.setImageResource(R.drawable.icon_home_entry_doing);
+        } else if (TextUtils.equals(teacherUserInfo.entryStatus, TeacherInfoConstants.ENTRY_STATUS_PASS)) {
+            //入驻审核通过
+            mViewBinding.ivCert.setImageResource(R.drawable.icon_home_cert_complete);
+        } else {
+            //未通过或者未申请
+            mViewBinding.ivCert.setImageResource(R.drawable.icon_home_un_certification);
+        }
+    }
+
+    private void handleBadgeUI(String tag) {
+        int badgeAbleCount = 0;
+        boolean enableStyleBadge = isEnableForBadge(tag, STYLE_TYPE);
+        if (enableStyleBadge) {
+            badgeAbleCount++;
+        }
+        boolean enableVideoBadge = isEnableForBadge(tag, VIDEON_TYPE);
+        if (enableVideoBadge) {
+            badgeAbleCount++;
+        }
+        boolean enableLiveBadge = isEnableForBadge(tag, LIVE_TYPE);
+        if (enableLiveBadge) {
+            badgeAbleCount++;
+        }
+
+        boolean enableAlbumBadge = isEnableForBadge(tag, MUSIC_TYPE);
+        if (enableAlbumBadge) {
+            badgeAbleCount++;
+        }
+        mViewBinding.ivStyleBadge.setImageResource(enableStyleBadge ? R.drawable.icon_style_badge_new_able : R.drawable.icon_style_badge_new_enable);
+        mViewBinding.ivVideoBadge.setImageResource(enableVideoBadge ? R.drawable.icon_video_badge_new_able : R.drawable.icon_video_badge_new_enable);
+        mViewBinding.ivLiveBadge.setImageResource(enableLiveBadge ? R.drawable.icon_live_badge_new_able : R.drawable.icon_live_badge_new_enable);
+        mViewBinding.ivAlbumBadge.setImageResource(enableAlbumBadge ? R.drawable.icon_album_badge_new_able : R.drawable.icon_album_badge_new_enable);
+        mViewBinding.tvMedalValue.setText(String.format("%d/4", badgeAbleCount));
+    }
+
+    private boolean isEnableForBadge(String tag, String type) {
+        if (TextUtils.isEmpty(tag)) {
+            return false;
+        }
+        return tag.contains(type);
     }
 
     @Override
@@ -31,4 +345,17 @@ public class NewHomeFragment extends BaseMVPFragment<FragmentNewHomeLayoutBindin
     protected HomePresenter createPresenter() {
         return new HomePresenter();
     }
+
+    @Override
+    public void onClick(View v) {
+        int id = v.getId();
+        if (id == R.id.fl_course_enter) {
+            if (UiUtils.isFastClick()) {
+                return;
+            }
+            if (mRecentCourses != null) {
+                gotoCourseDetail(mRecentCourses);
+            }
+        }
+    }
 }

+ 35 - 0
teacher/src/main/java/com/cooleshow/teacher/widgets/HomeHotMusicSheetItemDecoration.java

@@ -0,0 +1,35 @@
+package com.cooleshow.teacher.widgets;
+
+import android.graphics.Rect;
+import android.view.View;
+
+import androidx.recyclerview.widget.RecyclerView;
+
+/**
+ * Author by pq, Date on 2021/3/18 0018.
+ */
+public class HomeHotMusicSheetItemDecoration extends RecyclerView.ItemDecoration {
+
+    private int top;
+    private int left;
+    private int bottom;
+    private int right;
+    private int center;
+
+    public HomeHotMusicSheetItemDecoration(int top, int left, int bottom, int right, int center) {
+        this.top = top;
+        this.left = left;
+        this.bottom = bottom;
+        this.right = right;
+        this.center = center;
+    }
+
+    @Override
+    public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
+        //每行都只有2个
+        int childLayoutPosition = parent.getChildLayoutPosition(view);
+        outRect.top = top;
+        outRect.bottom = bottom;
+        outRect.right = right;
+    }
+}

+ 139 - 0
teacher/src/main/java/com/cooleshow/teacher/widgets/HomeHotMusicSheetItemView.java

@@ -0,0 +1,139 @@
+package com.cooleshow.teacher.widgets;
+
+import android.content.Context;
+import android.text.TextUtils;
+import android.util.AttributeSet;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.FrameLayout;
+import android.widget.LinearLayout;
+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.SizeUtils;
+import com.cooleshow.base.utils.UiUtils;
+import com.cooleshow.teacher.R;
+import com.cooleshow.teacher.bean.HomeHotMusicSheetBean;
+
+import androidx.annotation.NonNull;
+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;
+    private LinearLayout mLlMusicSubject;
+    private View mViewLine;
+    private HomeHotMusicSheetBean.RowsBean mBean;
+
+    public HomeHotMusicSheetItemView(@NonNull Context context) {
+        this(context, null);
+    }
+
+    public HomeHotMusicSheetItemView(@NonNull Context context, @Nullable AttributeSet attrs) {
+        this(context, attrs, -1);
+    }
+
+    public HomeHotMusicSheetItemView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
+        super(context, attrs, defStyleAttr);
+        init();
+    }
+
+    private void init() {
+        LayoutInflater.from(getContext()).inflate(R.layout.view_hot_music_sheet_child_layout, this);
+        mTvTag = findViewById(R.id.tv_tag);
+        mTvName = findViewById(R.id.tv_name);
+        mTvAuthor = findViewById(R.id.tv_author);
+        mTvUploadAuthor = findViewById(R.id.tv_upload_author);
+        mLlMusicSubject = findViewById(R.id.ll_music_subject);
+        mViewLine = findViewById(R.id.view_line);
+        setOnClickListener(new OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if (mBean != null) {
+                    if (UiUtils.isFastClick()) {
+                        return;
+                    }
+                    ARouter.getInstance().build(RouterPath.WebCenter.ACTIVITY_ACCOMPANY_HTML)
+                            .withString("url", String.format(WebConstants.SCORE_DETAIL_PAGE, mBean.id))
+                            .withBoolean("isHideTitle", true)
+                            .withBoolean("statusBarTextColor", true)
+                            .withBoolean("isOpenLight", true)
+                            .withInt("orientation", 0)
+                            .navigation();
+                }
+            }
+        });
+
+    }
+
+    public void setData(HomeHotMusicSheetBean.RowsBean data) {
+        this.mBean = data;
+        //曲谱名称
+        if (mTvName != null) {
+            mTvName.setText(data.musicSheetName);
+        }
+        //作者
+        if (mTvAuthor != null) {
+            mTvAuthor.setText(String.format("-%s", data.composer));
+        }
+        //上传人
+        if (mTvUploadAuthor != null) {
+            mTvUploadAuthor.setText(String.format("上传者:%s", data.addName));
+        }
+        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);
+        }
+        mLlMusicSubject.removeAllViews();
+        if (!TextUtils.isEmpty(data.musicSubject)) {
+            String[] split = data.musicSubject.split(",");
+            if (split != null && split.length > 0) {
+                for (int i = 0; i < split.length; i++) {
+                    createSubjectView(split[i]);
+                }
+            }
+        }
+    }
+
+    private void createSubjectView(String text) {
+        TextView textView = (TextView) LayoutInflater.from(getContext()).inflate(com.cooleshow.base.R.layout.view_subject_item_layout, mLlMusicSubject, false);
+        textView.setText(text);
+        textView.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_2dc7aa));
+        textView.setBackgroundResource(com.cooleshow.base.R.drawable.shape_effbf9_9dp);
+        LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
+        if (mLlMusicSubject.getChildCount() >= 1) {
+            params.setMargins(SizeUtils.dp2px(4), 0, 0, 0);
+        }
+        mLlMusicSubject.addView(textView, params);
+    }
+
+    public void setDividingLineIsShow(boolean isShow) {
+        if (mViewLine != null) {
+            mViewLine.setVisibility(isShow ? View.VISIBLE : View.INVISIBLE);
+        }
+    }
+}

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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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

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

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

@@ -0,0 +1,7 @@
+<?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>

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

@@ -0,0 +1,7 @@
+<?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>

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

@@ -0,0 +1,7 @@
+<?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>

+ 471 - 13
teacher/src/main/res/layout/fragment_new_home_layout.xml

@@ -1,14 +1,18 @@
 <?xml version="1.0" encoding="utf-8"?>
-<androidx.core.widget.NestedScrollView 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="match_parent">
 
     <androidx.constraintlayout.widget.ConstraintLayout
+        android:id="@+id/cs_header"
         android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:paddingStart="25dp">
+        android:layout_height="wrap_content"
+        android:background="@color/white"
+        android:paddingStart="25dp"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintTop_toTopOf="parent">
 
         <View
             android:id="@+id/view_status_bar"
@@ -17,37 +21,491 @@
             app:layout_constraintTop_toTopOf="parent" />
 
         <TextView
+            android:text="您好"
             android:id="@+id/tv_teacher_name"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
+            android:layout_marginTop="24dp"
             android:includeFontPadding="false"
-            android:textColor="@color/color_333333"
+            android:textColor="@color/color_1a1a1a"
             android:textSize="@dimen/sp_22"
+            android:textStyle="bold"
             app:layout_constraintLeft_toLeftOf="parent"
             app:layout_constraintTop_toBottomOf="@+id/view_status_bar"
             tools:text="您好,李老师" />
 
         <ImageView
             android:id="@+id/iv_vip"
-            android:layout_marginStart="6dp"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
+            android:layout_marginStart="6dp"
+            android:layout_marginBottom="2dp"
             android:src="@drawable/icon_vip_enable"
             app:layout_constraintBottom_toBottomOf="@+id/tv_teacher_name"
             app:layout_constraintLeft_toRightOf="@+id/tv_teacher_name" />
 
         <ImageView
-            android:visibility="gone"
             android:id="@+id/iv_scan"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_marginEnd="5dp"
-            android:paddingStart="12dp"
-            android:paddingTop="12dp"
-            android:paddingEnd="12dp"
-            android:paddingBottom="12dp"
-            android:src="@drawable/icon_scan_for_teacher" />
+            android:padding="12dp"
+            android:src="@drawable/icon_scan_for_teacher"
+            android:visibility="visible"
+            app:layout_constraintBottom_toBottomOf="@+id/tv_teacher_name"
+            app:layout_constraintRight_toLeftOf="@+id/im_message"
+            app:layout_constraintTop_toTopOf="@+id/tv_teacher_name" />
 
+        <ImageView
+            android:id="@+id/im_message"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginRight="@dimen/dp_17"
+            android:padding="8dp"
+            android:src="@drawable/icon_top_message"
+            app:layout_constraintBottom_toBottomOf="@+id/tv_teacher_name"
+            app:layout_constraintRight_toRightOf="parent"
+            app:layout_constraintTop_toTopOf="@+id/tv_teacher_name" />
 
+        <View
+            android:id="@+id/view_unread_message"
+            android:layout_width="@dimen/dp_7"
+            android:layout_height="@dimen/dp_7"
+            android:layout_marginTop="2dp"
+            android:layout_marginRight="2dp"
+            android:background="@drawable/bg_red_ovil"
+            android:visibility="gone"
+            app:layout_constraintRight_toRightOf="@+id/im_message"
+            app:layout_constraintTop_toTopOf="@+id/im_message"
+            tools:visibility="visible" />
     </androidx.constraintlayout.widget.ConstraintLayout>
-</androidx.core.widget.NestedScrollView>
+
+    <androidx.core.widget.NestedScrollView
+        android:layout_width="match_parent"
+        android:layout_height="0dp"
+        android:overScrollMode="never"
+        android:scrollbars="none"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/cs_header">
+
+        <androidx.constraintlayout.widget.ConstraintLayout
+            android:paddingBottom="20dp"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content">
+
+            <View
+                android:id="@+id/top_view_bg"
+                android:layout_width="match_parent"
+                android:layout_height="0dp"
+                android:background="@color/white"
+                app:layout_constraintBottom_toBottomOf="@+id/top_help_line"
+                app:layout_constraintTop_toTopOf="parent" />
+
+            <TextView
+                android:id="@+id/tv_score_name"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="25dp"
+                android:text="评分"
+                android:textColor="@color/color_666666"
+                android:textSize="@dimen/sp_12"
+                app:layout_constraintLeft_toLeftOf="parent"
+                app:layout_constraintTop_toTopOf="parent" />
+
+            <RatingBar
+                android:id="@+id/rating_bar"
+                style="@style/HomeRatingBar"
+                android:layout_width="wrap_content"
+                android:layout_height="19dp"
+                android:layout_marginStart="4dp"
+                android:numStars="5"
+                android:rating="0"
+                android:stepSize="1"
+                android:visibility="visible"
+                app:layout_constraintBottom_toBottomOf="@+id/tv_score_name"
+                app:layout_constraintLeft_toRightOf="@+id/tv_score_name"
+                app:layout_constraintTop_toTopOf="@+id/tv_score_name" />
+
+
+            <ImageView
+                android:id="@+id/iv_style_badge"
+                android:layout_width="23dp"
+                android:layout_height="23dp"
+                android:layout_marginStart="25dp"
+                android:layout_marginTop="23dp"
+                android:background="@drawable/icon_style_badge_new_enable"
+                app:layout_constraintLeft_toLeftOf="parent"
+                app:layout_constraintTop_toBottomOf="@+id/rating_bar" />
+
+            <ImageView
+                android:id="@+id/iv_video_badge"
+                android:layout_width="23dp"
+                android:layout_height="23dp"
+                android:layout_marginStart="6dp"
+                android:background="@drawable/icon_video_badge_new_enable"
+                app:layout_constraintBottom_toBottomOf="@+id/iv_style_badge"
+                app:layout_constraintLeft_toRightOf="@+id/iv_style_badge"
+                app:layout_constraintTop_toTopOf="@+id/iv_style_badge" />
+
+
+            <ImageView
+                android:id="@+id/iv_live_badge"
+                android:layout_width="24dp"
+                android:layout_height="23dp"
+                android:layout_marginStart="6dp"
+                android:background="@drawable/icon_live_badge_new_enable"
+                app:layout_constraintBottom_toBottomOf="@+id/iv_video_badge"
+                app:layout_constraintLeft_toRightOf="@+id/iv_video_badge"
+                app:layout_constraintTop_toTopOf="@+id/iv_video_badge" />
+
+
+            <ImageView
+                android:id="@+id/iv_album_badge"
+                android:layout_width="23dp"
+                android:layout_height="23dp"
+                android:layout_marginStart="6dp"
+                android:background="@drawable/icon_album_badge_new_enable"
+                app:layout_constraintBottom_toBottomOf="@+id/iv_live_badge"
+                app:layout_constraintLeft_toRightOf="@+id/iv_live_badge"
+                app:layout_constraintTop_toTopOf="@+id/iv_live_badge" />
+
+
+            <TextView
+                android:id="@+id/tv_medal_name"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="12dp"
+                android:includeFontPadding="false"
+                android:text="勋章"
+                android:textColor="@color/color_666666"
+                android:textSize="@dimen/sp_14"
+                app:layout_constraintBottom_toBottomOf="@+id/iv_album_badge"
+                app:layout_constraintLeft_toRightOf="@+id/iv_album_badge"
+                app:layout_constraintTop_toTopOf="@+id/iv_album_badge" />
+
+
+            <TextView
+                android:id="@+id/tv_medal_value"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="6dp"
+                android:includeFontPadding="false"
+                android:text="0/4"
+                android:textColor="@color/color_666666"
+                android:textSize="@dimen/sp_14"
+                app:layout_constraintBottom_toBottomOf="@+id/tv_medal_name"
+                app:layout_constraintLeft_toRightOf="@+id/tv_medal_name"
+                app:layout_constraintTop_toTopOf="@+id/tv_medal_name" />
+
+            <ImageView
+                android:id="@+id/iv_cert"
+                android:layout_width="wrap_content"
+                android:layout_height="30dp"
+                android:layout_marginEnd="25dp"
+                android:adjustViewBounds="true"
+                android:src="@drawable/icon_home_un_certification"
+                app:layout_constraintBottom_toBottomOf="@+id/iv_style_badge"
+                app:layout_constraintRight_toRightOf="parent"
+                app:layout_constraintTop_toTopOf="@+id/iv_style_badge" />
+
+            <View
+                android:id="@+id/top_help_line"
+                android:layout_width="1px"
+                android:layout_height="1px"
+                android:layout_marginTop="17dp"
+                app:layout_constraintLeft_toLeftOf="parent"
+                app:layout_constraintTop_toBottomOf="@+id/iv_cert" />
+
+
+            <androidx.cardview.widget.CardView
+                android:id="@+id/bg_announcement"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="14dp"
+                android:layout_marginTop="@dimen/dp_12"
+                android:layout_marginEnd="14dp"
+                android:visibility="visible"
+                app:cardBackgroundColor="@color/white"
+                app:cardCornerRadius="10dp"
+                app:cardElevation="2dp"
+                app:layout_constraintLeft_toLeftOf="parent"
+                app:layout_constraintTop_toBottomOf="@+id/top_view_bg">
+
+                <androidx.constraintlayout.widget.ConstraintLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="horizontal">
+
+                    <ImageView
+                        android:id="@+id/iv_bell"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_marginLeft="10dp"
+                        android:src="@drawable/icon_home_bell"
+                        app:layout_constraintBottom_toBottomOf="parent"
+                        app:layout_constraintLeft_toLeftOf="parent"
+                        app:layout_constraintTop_toTopOf="parent" />
+
+                    <TextView
+                        android:id="@+id/tv_notice_content"
+                        android:layout_width="wrap_content"
+                        android:layout_height="44dp"
+                        android:layout_marginStart="2dp"
+                        android:gravity="center"
+                        android:includeFontPadding="false"
+                        android:textColor="@color/color_1a1a1a"
+                        android:textSize="@dimen/sp_14"
+                        app:layout_constraintBottom_toBottomOf="parent"
+                        app:layout_constraintLeft_toRightOf="@+id/iv_bell"
+                        app:layout_constraintTop_toTopOf="parent"
+                        tools:text="网络教室升级公告" />
+
+                    <ImageView
+                        android:id="@+id/im_notice_list"
+                        android:layout_width="@dimen/dp_38"
+                        android:layout_height="@dimen/dp_38"
+                        android:layout_marginRight="@dimen/dp_1"
+                        android:padding="@dimen/dp_10"
+                        android:src="@drawable/icon_calendar_next_month"
+                        app:layout_constraintBottom_toBottomOf="parent"
+                        app:layout_constraintRight_toRightOf="parent"
+                        app:layout_constraintTop_toTopOf="parent" />
+                </androidx.constraintlayout.widget.ConstraintLayout>
+            </androidx.cardview.widget.CardView>
+
+            <androidx.cardview.widget.CardView
+                android:id="@+id/fl_top_menu"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="14dp"
+                android:layout_marginTop="12dp"
+                android:layout_marginEnd="14dp"
+                android:visibility="visible"
+                app:cardBackgroundColor="@color/white"
+                app:cardCornerRadius="10dp"
+                app:cardElevation="2dp"
+                app:cardPreventCornerOverlap="true"
+                app:cardUseCompatPadding="false"
+                app:layout_constraintTop_toBottomOf="@+id/bg_announcement">
+
+                <androidx.viewpager.widget.ViewPager
+                    android:id="@+id/viewpager_menu"
+                    android:layout_width="match_parent"
+                    android:layout_height="@dimen/dp_90"
+                    android:overScrollMode="never"
+                    android:scrollbars="none" />
+            </androidx.cardview.widget.CardView>
+
+            <androidx.cardview.widget.CardView
+                android:id="@+id/fl_course_enter"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="25dp"
+                android:layout_marginTop="24dp"
+                android:layout_marginEnd="25dp"
+                android:visibility="gone"
+                app:cardBackgroundColor="@color/white"
+                app:cardCornerRadius="10dp"
+                app:cardElevation="2dp"
+                app:cardPreventCornerOverlap="true"
+                app:cardUseCompatPadding="false"
+                app:layout_constraintTop_toBottomOf="@+id/fl_top_menu">
+
+                <androidx.constraintlayout.widget.ConstraintLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="70dp">
+
+                    <TextView
+                        android:id="@+id/tv_live_title"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_marginStart="120dp"
+                        android:includeFontPadding="false"
+                        android:text="您有新课程即将开始"
+                        android:textColor="@color/color_1a1a1a"
+                        android:textSize="@dimen/sp_16"
+                        app:layout_constraintBottom_toTopOf="@+id/alarm_icon"
+                        app:layout_constraintLeft_toLeftOf="parent"
+                        app:layout_constraintTop_toTopOf="parent"
+                        app:layout_constraintVertical_chainStyle="packed" />
+
+                    <ImageView
+                        android:id="@+id/alarm_icon"
+                        android:layout_width="@dimen/dp_15"
+                        android:layout_height="@dimen/dp_15"
+                        android:layout_marginTop="10dp"
+                        android:src="@mipmap/small_alarm_clock"
+                        app:layout_constraintBottom_toBottomOf="parent"
+                        app:layout_constraintLeft_toLeftOf="@+id/tv_live_title"
+                        app:layout_constraintTop_toBottomOf="@+id/tv_live_title" />
+
+
+                    <TextView
+                        android:id="@+id/tv_live_time"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_marginTop="@dimen/dp_1"
+                        android:layout_marginBottom="@dimen/dp_5"
+                        android:paddingStart="5dp"
+                        android:textColor="@color/color_FF806F"
+                        android:textSize="@dimen/sp_13"
+                        app:layout_constraintBottom_toBottomOf="@+id/alarm_icon"
+                        app:layout_constraintLeft_toRightOf="@+id/alarm_icon"
+                        app:layout_constraintTop_toTopOf="@+id/alarm_icon"
+                        tools:text="今日 16:30-17:05" />
+
+
+                    <ImageView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_marginEnd="11dp"
+                        android:src="@drawable/icon_arrow_right_bg_tran"
+                        app:layout_constraintBottom_toBottomOf="parent"
+                        app:layout_constraintRight_toRightOf="parent"
+                        app:layout_constraintTop_toTopOf="parent" />
+
+                </androidx.constraintlayout.widget.ConstraintLayout>
+            </androidx.cardview.widget.CardView>
+
+
+            <com.airbnb.lottie.LottieAnimationView
+                android:id="@+id/iv_course_enter_anim"
+                android:layout_width="105dp"
+                android:layout_height="83dp"
+                android:layout_marginStart="11dp"
+                android:visibility="gone"
+                app:layout_constraintBottom_toBottomOf="@+id/fl_course_enter"
+                app:layout_constraintLeft_toLeftOf="@+id/fl_course_enter"
+                app:lottie_autoPlay="true"
+                app:lottie_loop="true" />
+
+            <androidx.constraintlayout.widget.ConstraintLayout
+                android:id="@+id/cl_hot_album"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="@dimen/dp_18"
+                android:visibility="visible"
+                app:layout_constraintTop_toBottomOf="@+id/fl_course_enter">
+
+                <View
+                    android:id="@+id/tv_hot_album_line"
+                    android:layout_width="4dp"
+                    android:layout_height="17dp"
+                    android:layout_marginStart="14dp"
+                    android:background="@drawable/shape_course_title_tag_bg"
+                    app:layout_constraintBottom_toBottomOf="@+id/tv_hot_album"
+                    app:layout_constraintLeft_toLeftOf="parent"
+                    app:layout_constraintTop_toTopOf="@+id/tv_hot_album" />
+
+                <TextView
+                    android:id="@+id/tv_hot_album"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="@dimen/dp_6"
+                    android:gravity="center"
+                    android:text="热门专辑"
+                    android:textColor="@color/color_333333"
+                    android:textSize="@dimen/sp_18"
+                    android:textStyle="bold"
+                    app:layout_constraintLeft_toRightOf="@+id/tv_hot_album_line"
+                    app:layout_constraintTop_toTopOf="parent" />
+
+                <TextView
+                    android:id="@+id/tv_hot_album_more"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginRight="@dimen/dp_14"
+                    android:background="@drawable/shape_f2f2f2_9dp"
+                    android:drawableEnd="@drawable/icon_next_right"
+                    android:drawablePadding="1dp"
+                    android:gravity="center"
+                    android:paddingStart="7dp"
+                    android:paddingTop="2dp"
+                    android:paddingEnd="3dp"
+                    android:paddingBottom="2dp"
+                    android:text="更多"
+                    android:textColor="@color/color_999999"
+                    android:textSize="@dimen/sp_12"
+                    app:layout_constraintBottom_toBottomOf="@+id/tv_hot_album"
+                    app:layout_constraintRight_toRightOf="parent"
+                    app:layout_constraintTop_toTopOf="@+id/tv_hot_album" />
+
+                <androidx.recyclerview.widget.RecyclerView
+                    android:id="@+id/rv_hot_album"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="12dp"
+                    android:overScrollMode="never"
+                    android:paddingLeft="@dimen/dp_7"
+                    android:paddingRight="@dimen/dp_7"
+                    android:scrollbars="none"
+                    app:layout_constraintTop_toBottomOf="@+id/tv_hot_album" />
+
+            </androidx.constraintlayout.widget.ConstraintLayout>
+
+
+            <androidx.constraintlayout.widget.ConstraintLayout
+                android:id="@+id/cl_hot_track"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="@dimen/dp_25"
+                android:visibility="visible"
+                app:layout_constraintTop_toBottomOf="@+id/cl_hot_album">
+
+                <View
+                    android:id="@+id/tv_hot_track_line"
+                    android:layout_width="4dp"
+                    android:layout_height="17dp"
+                    android:layout_marginStart="14dp"
+                    android:background="@drawable/shape_course_title_tag_bg"
+                    app:layout_constraintBottom_toBottomOf="@+id/tv_hot_track"
+                    app:layout_constraintLeft_toLeftOf="parent"
+                    app:layout_constraintTop_toTopOf="@+id/tv_hot_track" />
+
+                <TextView
+                    android:id="@+id/tv_hot_track"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="@dimen/dp_6"
+                    android:gravity="center"
+                    android:text="热门曲目"
+                    android:textColor="@color/color_333333"
+                    android:textSize="@dimen/sp_18"
+                    android:textStyle="bold"
+                    app:layout_constraintLeft_toRightOf="@+id/tv_hot_track_line"
+                    app:layout_constraintTop_toTopOf="parent" />
+
+                <TextView
+                    android:id="@+id/tv_hot_track_more"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginRight="@dimen/dp_14"
+                    android:background="@drawable/shape_f2f2f2_9dp"
+                    android:drawableEnd="@drawable/icon_next_right"
+                    android:drawablePadding="1dp"
+                    android:gravity="center"
+                    android:paddingStart="7dp"
+                    android:paddingTop="2dp"
+                    android:paddingEnd="3dp"
+                    android:paddingBottom="2dp"
+                    android:text="更多"
+                    android:textColor="@color/color_999999"
+                    android:textSize="@dimen/sp_12"
+                    app:layout_constraintBottom_toBottomOf="@+id/tv_hot_track"
+                    app:layout_constraintRight_toRightOf="parent"
+                    app:layout_constraintTop_toTopOf="@+id/tv_hot_track" />
+
+                <androidx.recyclerview.widget.RecyclerView
+                    android:id="@+id/rv_hot_track"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="12dp"
+                    android:overScrollMode="never"
+                    android:paddingLeft="@dimen/dp_14"
+                    android:scrollbars="none"
+                    app:layout_constraintTop_toBottomOf="@+id/tv_hot_track" />
+
+            </androidx.constraintlayout.widget.ConstraintLayout>
+        </androidx.constraintlayout.widget.ConstraintLayout>
+
+    </androidx.core.widget.NestedScrollView>
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 9 - 0
teacher/src/main/res/layout/item_home_hot_music_sheet_layout.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/ll_container"
+    android:layout_width="312dp"
+    android:layout_height="wrap_content"
+    android:background="@drawable/shape_8dp_white"
+    android:orientation="vertical">
+
+</LinearLayout>

+ 62 - 0
teacher/src/main/res/layout/layout_home_hot_album_item.xml

@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="utf-8"?>
+<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="wrap_content"
+    android:layout_height="wrap_content">
+
+    <com.cooleshow.base.widgets.QMUIRadiusImageView
+        android:id="@+id/im_pic"
+        android:layout_width="@dimen/dp_94"
+        android:layout_height="@dimen/dp_94"
+        android:layout_marginLeft="@dimen/dp_7"
+        android:layout_marginRight="@dimen/dp_7"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
+        app:qmui_corner_radius="10dp" />
+
+    <LinearLayout
+        android:id="@+id/img_root"
+        android:layout_width="wrap_content"
+        android:layout_height="@dimen/dp_16"
+        android:layout_marginStart="4dp"
+        android:layout_marginBottom="@dimen/dp_3"
+        android:background="@drawable/bg_434343_raduis"
+        android:gravity="center"
+        android:orientation="horizontal"
+        android:paddingStart="3dp"
+        android:paddingEnd="3dp"
+        app:layout_constraintBottom_toBottomOf="@+id/im_pic"
+        app:layout_constraintLeft_toLeftOf="@+id/im_pic">
+
+        <ImageView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:src="@drawable/icon_hot_album_collect_num_tag" />
+
+        <TextView
+            android:id="@+id/tv_collect_num"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:includeFontPadding="false"
+            android:paddingStart="3dp"
+            android:text="0人"
+            android:textColor="@color/white"
+            android:textSize="@dimen/sp_9" />
+
+    </LinearLayout>
+
+    <TextView
+        android:id="@+id/album_name"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="@dimen/dp_6"
+        android:ellipsize="end"
+        android:gravity="center"
+        android:includeFontPadding="false"
+        android:maxLines="1"
+        android:textColor="@color/black_333"
+        android:textSize="@dimen/sp_14"
+        app:layout_constraintLeft_toLeftOf="@+id/im_pic"
+        app:layout_constraintRight_toRightOf="@+id/im_pic"
+        app:layout_constraintTop_toBottomOf="@+id/im_pic" />
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 99 - 0
teacher/src/main/res/layout/view_hot_music_sheet_child_layout.xml

@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="utf-8"?>
+<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:paddingStart="11dp"
+    android:paddingEnd="11dp">
+
+    <TextView
+        android:id="@+id/tv_tag"
+        android:layout_width="30dp"
+        android:layout_height="17dp"
+        android:layout_marginTop="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_name"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:ellipsize="end"
+        android:includeFontPadding="false"
+        android:maxWidth="129dp"
+        android:lines="1"
+        android:paddingStart="6dp"
+        android:textColor="@color/color_1a1a1a"
+        android:textSize="@dimen/sp_16"
+        app:layout_constraintBottom_toBottomOf="@+id/tv_tag"
+        app:layout_constraintLeft_toRightOf="@+id/tv_tag"
+        app:layout_constraintRight_toLeftOf="@+id/tv_author"
+        app:layout_constraintTop_toTopOf="@+id/tv_tag"
+        tools:text="维瓦尔第 E第一维瓦尔第维瓦尔第维瓦尔第" />
+
+    <TextView
+        android:id="@+id/tv_author"
+        android:layout_width="68dp"
+        android:layout_height="wrap_content"
+        android:layout_marginEnd="25dp"
+        android:ellipsize="end"
+        android:includeFontPadding="false"
+        android:paddingStart="6dp"
+        android:lines="1"
+        android:textColor="@color/color_999999"
+        android:textSize="@dimen/sp_12"
+        app:layout_constraintBottom_toBottomOf="@+id/tv_name"
+        app:layout_constraintLeft_toRightOf="@+id/tv_name"
+        app:layout_constraintTop_toTopOf="@+id/tv_name"
+        tools:text="-维瓦尔第…维瓦尔第维瓦尔第" />
+
+    <ImageView
+        android:id="@+id/iv_play"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginEnd="14dp"
+        android:src="@drawable/icon_music_sheet_play"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toTopOf="parent" />
+
+
+    <TextView
+        android:id="@+id/tv_upload_author"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="10dp"
+        android:layout_marginEnd="25dp"
+        android:ellipsize="end"
+        android:includeFontPadding="false"
+        android:maxLines="1"
+        android:textColor="@color/color_999999"
+        android:textSize="@dimen/sp_12"
+        app:layout_constraintLeft_toLeftOf="@+id/tv_tag"
+        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:orientation="horizontal"
+        app:layout_constraintBottom_toBottomOf="@+id/tv_upload_author"
+        app:layout_constraintLeft_toRightOf="@+id/tv_upload_author"
+        app:layout_constraintRight_toLeftOf="@+id/iv_play"
+        app:layout_constraintTop_toTopOf="@+id/tv_upload_author" />
+
+    <View
+        android:id="@+id/view_line"
+        android:layout_width="match_parent"
+        android:layout_height="1dp"
+        android:layout_marginTop="15dp"
+        android:background="@color/color_e8e8e8"
+        app:layout_constraintTop_toBottomOf="@+id/tv_upload_author" />
+</androidx.constraintlayout.widget.ConstraintLayout>