Просмотр исходного кода

删除老师端首页精品曲目模块

Pq 2 лет назад
Родитель
Сommit
b21de53865

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

@@ -32,8 +32,6 @@ public interface HomeContract {
         void getHotAlbumListSuccess(HomeHotAlbumListBean homeHotAlbumListBean);
 
         void getHotMusicSheetListSuccess(HomeHotMusicSheetBean homeHotMusicSheetBean);
-
-        void getGoodMusicSheetListSuccess(HomeHotMusicSheetBean homeHotMusicSheetBean);
     }
 
     interface Presenter {

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

@@ -221,27 +221,4 @@ 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 - 4
teacher/src/main/java/com/cooleshow/teacher/ui/main/HomeFragment.kt

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

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

@@ -81,7 +81,7 @@ public class NewHomeFragment extends BaseMVPFragment<FragmentNewHomeLayoutBindin
     private int degreeFlag = 0;//老师学历认证
     private String entryStatus = "";//达人认证状态
     private SmartRefreshLayout refreshLayout;
-    private HomeGoodMusicSheetAdapter mGoodMusicSheetAdapter;
+//    private HomeGoodMusicSheetAdapter mGoodMusicSheetAdapter;
 
     @Override
     protected void initView(View rootView) {
@@ -100,13 +100,6 @@ public class NewHomeFragment extends BaseMVPFragment<FragmentNewHomeLayoutBindin
         mViewBinding.rvHotAlbum.addItemDecoration(hotAlbumItemDecoration);
         mViewBinding.rvHotAlbum.setAdapter(mAlbumAdapter);
 
-        mGoodMusicSheetAdapter = new HomeGoodMusicSheetAdapter();
-        LinearLayoutManager layoutManager = new LinearLayoutManager(getContext());
-        layoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
-        HomeHotMusicSheetItemDecoration itemDecoration2 = new HomeHotMusicSheetItemDecoration(0, SizeUtils.dp2px(12), 0, SizeUtils.dp2px(12), 0);
-        mViewBinding.rvGoodTrack.addItemDecoration(itemDecoration2);
-        mViewBinding.rvGoodTrack.setLayoutManager(layoutManager);
-        mViewBinding.rvGoodTrack.setAdapter(mGoodMusicSheetAdapter);
 
         LinearLayoutManager musicSheetManager = new LinearLayoutManager(getContext());
         musicSheetManager.setOrientation(LinearLayoutManager.HORIZONTAL);
@@ -151,13 +144,10 @@ public class NewHomeFragment extends BaseMVPFragment<FragmentNewHomeLayoutBindin
         mViewBinding.bgAnnouncement2.setOnClickListener(this);
         mViewBinding.tvHotAlbumMore.setOnClickListener(this);
         mViewBinding.tvHotTrackMore.setOnClickListener(this);
-        mViewBinding.tvGoodTrackMore.setOnClickListener(this);
         mViewBinding.refreshLayout.setOnRefreshListener(refreshLayout -> {
             mViewBinding.refreshLayout.finishRefresh();
             presenter.getHotAlbumList();
             presenter.getHotMusicSheetList();
-            //精品曲目
-            presenter.getGoodMusicSheetList();
             presenter.queryCountOfUnread();
             presenter.queryLiveAndVideo();
             presenter.appHome();
@@ -205,8 +195,6 @@ public class NewHomeFragment extends BaseMVPFragment<FragmentNewHomeLayoutBindin
             presenter.getHotAlbumList();
             //热门曲目
             presenter.getHotMusicSheetList();
-            //精品曲目
-            presenter.getGoodMusicSheetList();
         }
     }
 
@@ -441,38 +429,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);
-        }
-    }
-
-
     public void getTeacherInfoSuccess(TeacherUserInfo teacherUserInfo) {
         if (teacherUserInfo == null) {
             return;
@@ -639,11 +595,6 @@ public class NewHomeFragment extends BaseMVPFragment<FragmentNewHomeLayoutBindin
             WebStartHelper.startHotMusicSheetList();
             return;
         }
-        if(id == R.id.tv_good_track_more){
-            //精品曲目更多
-            WebStartHelper.startGoodMusicSheetList();
-            return;
-        }
         if (id == R.id.view_badge) {
             showBadgeDialog();
             return;

+ 1 - 64
teacher/src/main/res/layout/fragment_new_home_layout.xml

@@ -561,75 +561,12 @@
                 </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="wrap_content"
-                        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_18"
                     android:visibility="visible"
-                    app:layout_constraintTop_toBottomOf="@+id/cl_good_track">
+                    app:layout_constraintTop_toBottomOf="@+id/cl_hot_album">
 
                     <View
                         android:id="@+id/tv_hot_track_line"