瀏覽代碼

去掉学生端首页精品曲目模块,在热门曲目模块增加字段

Pq 2 年之前
父節點
當前提交
92a61abc4d

+ 0 - 1
student/src/main/java/com/cooleshow/student/adapter/HomeGoodMusicSheetAdapter.java

@@ -37,7 +37,6 @@ public class HomeGoodMusicSheetAdapter extends BaseQuickAdapter<HomeHotMusicShee
             for (int i = 0; i < homeHotMusicSheetItemBean.sheetBeans.size(); i++) {
                 HomeHotMusicSheetBean.RowsBean homeHotMusicSheetBean = homeHotMusicSheetItemBean.sheetBeans.get(i);
                 HomeHotMusicSheetItemView hotMusicSheetItemView = new HomeHotMusicSheetItemView(getContext());
-                hotMusicSheetItemView.setIsGood(true);
                 hotMusicSheetItemView.setData(homeHotMusicSheetBean);
                 int result = i % (NewHomeFragment.MAX_HOT_MUSIC_LIST_PAGE - 1);
                 if (i == homeHotMusicSheetItemBean.sheetBeans.size() - 1 && result == 0) {

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

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

+ 0 - 2
student/src/main/java/com/cooleshow/student/contract/HomeContract.java

@@ -40,8 +40,6 @@ public interface HomeContract {
 
         void getHotMusicSheetListSuccess(HomeHotMusicSheetBean homeHotMusicSheetBean);
 
-        void getGoodMusicSheetListSuccess(HomeHotMusicSheetBean homeHotMusicSheetBean);
-
         void getRecommendTalentSuccess(ArrayList<RecommendTalentListBean> talentListBeans);
 
         void getHotNewsSuccess(int page, HomeHotNewsBean homeHotNewsBean);

+ 0 - 23
student/src/main/java/com/cooleshow/student/presenter/main/HomePresenter.java

@@ -385,29 +385,6 @@ public class HomePresenter extends BasePresenter<HomeContract.HomeView> implemen
         });
     }
 
-    /**
-     * 获取热门曲目
-     */
-    public void getGoodMusicSheetList() {
-        if (getView() != null) {
-            getView().showLoading();
-        }
-        JSONObject jsonObject = new JSONObject();
-        try {
-            jsonObject.putOpt("myself", false);
-            jsonObject.putOpt("exquisiteFlag", "1");//精品标志(0:否;1:是)
-        } 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().getGoodMusicSheetListSuccess(data);
-                }
-            }
-        });
-    }
 
     /**
      * 获取推荐达人列表

+ 0 - 5
student/src/main/java/com/cooleshow/student/ui/main/HomeFragment.java

@@ -627,11 +627,6 @@ public class HomeFragment extends BaseMVPFragment<FragmentHomeLayoutBinding, Hom
     }
 
     @Override
-    public void getGoodMusicSheetListSuccess(HomeHotMusicSheetBean homeHotMusicSheetBean) {
-
-    }
-
-    @Override
     public void getRecommendTalentSuccess(ArrayList<RecommendTalentListBean> talentListBeans) {
 
     }

+ 0 - 53
student/src/main/java/com/cooleshow/student/ui/main/NewHomeFragment.java

@@ -108,7 +108,6 @@ public class NewHomeFragment extends BaseMVPFragment<FragmentNewHomeLayoutBindin
             switchTabStyle(position);
         }
     };
-    private HomeGoodMusicSheetAdapter mGoodMusicSheetAdapter;
 
     @Override
     protected FragmentNewHomeLayoutBinding getLayoutView() {
@@ -137,7 +136,6 @@ public class NewHomeFragment extends BaseMVPFragment<FragmentNewHomeLayoutBindin
         mViewBinding.viewTalentStyleClick.setOnClickListener(this);
         mViewBinding.viewHotNewsClick.setOnClickListener(this);
         mViewBinding.viewSearchBg.setOnClickListener(this);
-        mViewBinding.tvGoodTrackMore.setOnClickListener(this);
     }
 
     @Override
@@ -151,16 +149,6 @@ public class NewHomeFragment extends BaseMVPFragment<FragmentNewHomeLayoutBindin
         mViewBinding.rvHotAlbum.addItemDecoration(hotAlbumItemDecoration);
         mViewBinding.rvHotAlbum.setAdapter(mAlbumAdapter);
 
-        //精品曲目
-        LinearLayoutManager goodMusicSheetManager = new LinearLayoutManager(getContext());
-        goodMusicSheetManager.setOrientation(LinearLayoutManager.HORIZONTAL);
-        mGoodMusicSheetAdapter = new HomeGoodMusicSheetAdapter();
-        HomeHotMusicSheetItemDecoration goodMusicSheetItemDecoration = new HomeHotMusicSheetItemDecoration(0, 0, 0, SizeUtils.dp2px(12), 0);
-        mViewBinding.rvGoodTrack.addItemDecoration(goodMusicSheetItemDecoration);
-        mViewBinding.rvGoodTrack.setLayoutManager(goodMusicSheetManager);
-        mViewBinding.rvGoodTrack.setAdapter(mGoodMusicSheetAdapter);
-
-
         //热门曲目
         LinearLayoutManager musicSheetManager = new LinearLayoutManager(getContext());
         musicSheetManager.setOrientation(LinearLayoutManager.HORIZONTAL);
@@ -274,8 +262,6 @@ public class NewHomeFragment extends BaseMVPFragment<FragmentNewHomeLayoutBindin
             presenter.appHome();
             presenter.userAccountPage();
             presenter.getHotMusicSheetList();
-            //获取精品曲目
-            presenter.getGoodMusicSheetList();
             presenter.getRecommendTalentList();
             refreshBottomData();
         });
@@ -400,8 +386,6 @@ public class NewHomeFragment extends BaseMVPFragment<FragmentNewHomeLayoutBindin
             presenter.userAccountPage();
             //获取热门曲目
             presenter.getHotMusicSheetList();
-            //获取精品曲目
-            presenter.getGoodMusicSheetList();
         }
     }
 
@@ -662,37 +646,6 @@ public class NewHomeFragment extends BaseMVPFragment<FragmentNewHomeLayoutBindin
     }
 
     @Override
-    public void getGoodMusicSheetListSuccess(HomeHotMusicSheetBean homeHotMusicSheetBean) {
-        if (isDetached() || homeHotMusicSheetBean == null) {
-            return;
-        }
-        ArrayList<HomeHotMusicSheetItemBean> itemBeans = new ArrayList<>();
-        List<HomeHotMusicSheetBean.RowsBean> rows = homeHotMusicSheetBean.rows;
-        if (rows != null && rows.size() > 0) {
-            mViewBinding.clGoodTrack.setVisibility(View.VISIBLE);
-            int pageCount = 0;
-            int pageResult = rows.size() % MAX_GOOD_MUSIC_LIST_PAGE;
-            if (pageResult == 0) {
-                pageCount = rows.size() / MAX_GOOD_MUSIC_LIST_PAGE;
-            } else {
-                pageCount = (rows.size() / MAX_GOOD_MUSIC_LIST_PAGE) + 1;
-            }
-            for (int i = 0; i < pageCount; i++) {
-                HomeHotMusicSheetItemBean hotMusicSheetItemBean = new HomeHotMusicSheetItemBean();
-                for (int k = i * MAX_GOOD_MUSIC_LIST_PAGE; k < rows.size() && k < (i + 1) * MAX_GOOD_MUSIC_LIST_PAGE; k++) {
-                    hotMusicSheetItemBean.sheetBeans.add(rows.get(k));
-                }
-                itemBeans.add(hotMusicSheetItemBean);
-            }
-            if (mGoodMusicSheetAdapter != null) {
-                mGoodMusicSheetAdapter.setNewInstance(itemBeans);
-            }
-        } else {
-            mViewBinding.clGoodTrack.setVisibility(View.GONE);
-        }
-    }
-
-    @Override
     public void getRecommendTalentSuccess(ArrayList<RecommendTalentListBean> talentListBeans) {
         if (isDetached()) {
             return;
@@ -845,12 +798,6 @@ public class NewHomeFragment extends BaseMVPFragment<FragmentNewHomeLayoutBindin
             mViewBinding.viewPagerBottom.setCurrentItem(1);
             return;
         }
-
-        if(id == R.id.tv_good_track_more){
-            //精品曲目更多
-            WebStartHelper.startGoodMusicSheetList();
-            return;
-        }
     }
 
     /**

+ 2 - 11
student/src/main/java/com/cooleshow/student/widgets/HomeHotMusicSheetItemView.java

@@ -36,7 +36,6 @@ public class HomeHotMusicSheetItemView extends FrameLayout {
     private LinearLayout mLlMusicSubject;
     private View mViewLine;
     private HomeHotMusicSheetBean.RowsBean mBean;
-    private boolean isGood = false;//是否是精品曲目
     private ImageView mIvGoodTag;
 
     public HomeHotMusicSheetItemView(@NonNull Context context) {
@@ -81,16 +80,6 @@ public class HomeHotMusicSheetItemView extends FrameLayout {
 
     }
 
-    /**
-     * 设置是否是精品
-     */
-    public void setIsGood(boolean isGood) {
-        this.isGood = isGood;
-        if (mIvGoodTag != null) {
-            mIvGoodTag.setVisibility(isGood ? View.VISIBLE : View.GONE);
-        }
-    }
-
     public void setData(HomeHotMusicSheetBean.RowsBean data) {
         this.mBean = data;
         //曲谱名称
@@ -133,6 +122,8 @@ public class HomeHotMusicSheetItemView extends FrameLayout {
             mTvTag.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_3591ce));
             mTvTag.setBackgroundResource(R.drawable.shape_3591ce_border);
         }
+        //精品曲目标记
+        mIvGoodTag.setVisibility(TextUtils.equals(data.exquisiteFlag, "1") ? View.VISIBLE : View.GONE);
     }
 
     private void createSubjectView(String text) {

+ 1 - 65
student/src/main/res/layout/fragment_new_home_layout.xml

@@ -458,77 +458,13 @@
 
                         </androidx.constraintlayout.widget.ConstraintLayout>
 
-
-                        <androidx.constraintlayout.widget.ConstraintLayout
-                            android:id="@+id/cl_good_track"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:layout_marginTop="@dimen/dp_30"
-                            android:visibility="gone"
-                            app:layout_constraintTop_toBottomOf="@+id/cl_hot_album">
-
-                            <View
-                                android:id="@+id/tv_good_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_good_track"
-                                app:layout_constraintLeft_toLeftOf="parent"
-                                app:layout_constraintTop_toTopOf="@+id/tv_good_track" />
-
-                            <TextView
-                                android:id="@+id/tv_good_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_good_track_line"
-                                app:layout_constraintTop_toTopOf="parent" />
-
-                            <TextView
-                                android:id="@+id/tv_good_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_good_track"
-                                app:layout_constraintRight_toRightOf="parent"
-                                app:layout_constraintTop_toTopOf="@+id/tv_good_track" />
-
-                            <androidx.recyclerview.widget.RecyclerView
-                                android:id="@+id/rv_good_track"
-                                android:layout_width="match_parent"
-                                android:layout_height="239dp"
-                                android:layout_marginTop="12dp"
-                                android:overScrollMode="never"
-                                android:paddingLeft="@dimen/dp_14"
-                                android:scrollbars="none"
-                                app:layout_constraintTop_toBottomOf="@+id/tv_good_track" />
-
-                        </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_30"
                             android:visibility="gone"
-                            app:layout_constraintTop_toBottomOf="@+id/cl_good_track">
+                            app:layout_constraintTop_toBottomOf="@+id/cl_hot_album">
 
                             <View
                                 android:id="@+id/tv_hot_track_line"

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

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

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

@@ -123,6 +123,8 @@ public class HomeHotMusicSheetItemView extends FrameLayout {
             mTvTag.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.color_3591ce));
             mTvTag.setBackgroundResource(R.drawable.shape_3591ce_border);
         }
+        //精品标记
+        mIvGoodTag.setVisibility(TextUtils.equals(data.exquisiteFlag, "1") ? View.VISIBLE : View.GONE);
     }
 
     private void createSubjectView(String text) {