Pq 2 éve
szülő
commit
1cb783c483

+ 8 - 0
student/src/main/java/com/cooleshow/student/constants/CommonConfig.java

@@ -0,0 +1,8 @@
+package com.cooleshow.student.constants;
+
+/**
+ * Author by pq, Date on 2022/9/9.
+ */
+public class CommonConfig {
+    public static boolean isShowHomeFlashPage = true;//是否显示首页闪页弹窗,重新启动以及重新登录需要弹
+}

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

@@ -85,17 +85,6 @@ public class HomePresenter extends BasePresenter<HomeContract.HomeView> implemen
                     getView().hotAlbumListSuccess(data);
                 }
             }
-
-            @Override
-            public void onComplete() {
-                super.onComplete();
-            }
-
-            @Override
-            public void onError(Throwable e) {
-                super.onError(e);
-
-            }
         });
     }
 

+ 3 - 1
student/src/main/java/com/cooleshow/student/ui/main/MainActivity.java

@@ -36,6 +36,7 @@ import com.cooleshow.base.widgets.TabAnimationView;
 import com.cooleshow.student.App;
 import com.cooleshow.student.R;
 import com.cooleshow.student.adapter.HomePageAdapter;
+import com.cooleshow.student.constants.CommonConfig;
 import com.cooleshow.student.contract.MainContract;
 import com.cooleshow.student.databinding.ActivityMainBinding;
 import com.cooleshow.student.helper.PushIntentParseHelper;
@@ -158,7 +159,7 @@ public class MainActivity extends BaseMVPActivity<ActivityMainBinding, MainPrese
 
         HomePageAdapter homePageAdapter = new HomePageAdapter(this);
         mHomeFragment = new HomeFragment();
-        NewHomeFragment newHomeFragment =new NewHomeFragment();
+        NewHomeFragment newHomeFragment = new NewHomeFragment();
         CourseTableFragment courseTableFragment = new CourseTableFragment();
         MessageFragment messageFragment = new MessageFragment();
         shopMallFragment = new MallFragment();
@@ -359,6 +360,7 @@ public class MainActivity extends BaseMVPActivity<ActivityMainBinding, MainPrese
         if (event != null && event.eventCode == LoginStatusConstants.LOGIN_OUT) {
             IMManager.getInstance().logout();
             LiveConfig.isNeedReInitRTC = true;
+            CommonConfig.isShowHomeFlashPage = true;
             isNeedSetPushId = true;
             LogUtils.i("pq", "LoginStatusEvent:logout");
         }

+ 20 - 10
student/src/main/java/com/cooleshow/student/ui/main/NewHomeFragment.java

@@ -43,6 +43,7 @@ import com.cooleshow.student.bean.HomeStyleBean;
 import com.cooleshow.student.bean.HotAlbumBean;
 import com.cooleshow.student.bean.RecommendTalentListBean;
 import com.cooleshow.student.bean.StudentUserInfo;
+import com.cooleshow.student.constants.CommonConfig;
 import com.cooleshow.student.constants.CourseConstants;
 import com.cooleshow.student.contract.HomeContract;
 import com.cooleshow.student.databinding.FragmentNewHomeLayoutBinding;
@@ -97,7 +98,6 @@ public class NewHomeFragment extends BaseMVPFragment<FragmentNewHomeLayoutBindin
     private HotNewsFragment mHotNewsFragment;
     private ValueAnimator bottomTabValueAnimator;
     private boolean isCollapsed = false;//控制底部tab
-    private boolean isShowFlashPage = false;
 
     private ViewPager2.OnPageChangeCallback onPageChangeCallback = new ViewPager2.OnPageChangeCallback() {
         @Override
@@ -219,10 +219,6 @@ public class NewHomeFragment extends BaseMVPFragment<FragmentNewHomeLayoutBindin
                     }
                 });
         initListener();
-        //获取热门专辑
-        presenter.userAccountPage();
-        //获取热门曲目
-        presenter.getHotMusicSheetList();
     }
 
     private void initListener() {
@@ -375,14 +371,20 @@ public class NewHomeFragment extends BaseMVPFragment<FragmentNewHomeLayoutBindin
     public void onResume() {
         super.onResume();
         if (presenter != null) {
+            //红点
+            presenter.queryCountOfUnread();
             presenter.appHome();
             //获取课程信息
             presenter.queryLiveAndVideo();
             refreshBottomData();
-            //获取推荐达人列表
-            presenter.getRecommendTalentList();
             //查询个人信息
             presenter.queryUserInfo();
+            //获取推荐达人列表
+            presenter.getRecommendTalentList();
+            //获取热门专辑
+            presenter.userAccountPage();
+            //获取热门曲目
+            presenter.getHotMusicSheetList();
         }
     }
 
@@ -414,11 +416,11 @@ public class NewHomeFragment extends BaseMVPFragment<FragmentNewHomeLayoutBindin
         if (null == flashPage || flashPage.size() == 0) {
             return;
         }
-        if (isShowFlashPage) {
+        if (!CommonConfig.isShowHomeFlashPage) {
             return;
         }
         DialogUtils.showHomeDialog(getContext(), flashPage.get(0));
-        isShowFlashPage = true;
+        CommonConfig.isShowHomeFlashPage = false;
     }
 
     /**
@@ -472,7 +474,12 @@ public class NewHomeFragment extends BaseMVPFragment<FragmentNewHomeLayoutBindin
             return;
         }
         if (mAlbumAdapter != null) {
-            mAlbumAdapter.setNewInstance(homeHotAlbumListBean.rows);
+            if (homeHotAlbumListBean != null && homeHotAlbumListBean.rows != null && homeHotAlbumListBean.rows.size() > 0) {
+                mViewBinding.clHotAlbum.setVisibility(View.VISIBLE);
+                mAlbumAdapter.setNewInstance(homeHotAlbumListBean.rows);
+            } else {
+                mViewBinding.clHotAlbum.setVisibility(View.GONE);
+            }
         }
     }
 
@@ -614,6 +621,7 @@ public class NewHomeFragment extends BaseMVPFragment<FragmentNewHomeLayoutBindin
         ArrayList<HomeHotMusicSheetItemBean> itemBeans = new ArrayList<>();
         List<HomeHotMusicSheetBean.RowsBean> rows = homeHotMusicSheetBean.rows;
         if (rows != null && rows.size() > 0) {
+            mViewBinding.clHotTrack.setVisibility(View.VISIBLE);
             int pageCount = 0;
             int pageResult = rows.size() % MAX_HOT_MUSIC_LIST_PAGE;
             if (pageResult == 0) {
@@ -631,6 +639,8 @@ public class NewHomeFragment extends BaseMVPFragment<FragmentNewHomeLayoutBindin
             if (mHomeHotMusicSheetAdapter != null) {
                 mHomeHotMusicSheetAdapter.setNewInstance(itemBeans);
             }
+        } else {
+            mViewBinding.clHotTrack.setVisibility(View.GONE);
         }
     }
 

+ 3 - 3
student/src/main/res/layout/fragment_new_home_layout.xml

@@ -399,7 +399,7 @@
                             android:layout_width="match_parent"
                             android:layout_height="wrap_content"
                             android:layout_marginTop="@dimen/dp_30"
-                            android:visibility="visible"
+                            android:visibility="gone"
                             app:layout_constraintTop_toBottomOf="@+id/fl_course_enter">
 
                             <View
@@ -463,7 +463,7 @@
                             android:layout_width="match_parent"
                             android:layout_height="wrap_content"
                             android:layout_marginTop="@dimen/dp_30"
-                            android:visibility="visible"
+                            android:visibility="gone"
                             app:layout_constraintTop_toBottomOf="@+id/cl_hot_album">
 
                             <View
@@ -527,7 +527,7 @@
                             android:layout_width="match_parent"
                             android:layout_height="wrap_content"
                             android:layout_marginTop="@dimen/dp_30"
-                            android:visibility="visible"
+                            android:visibility="gone"
                             app:layout_constraintTop_toBottomOf="@+id/cl_hot_track">
 
                             <View

+ 2 - 0
teacher/src/main/java/com/cooleshow/teacher/ui/homepage/HomePageActivity.java

@@ -282,6 +282,8 @@ public class HomePageActivity extends BaseMVPActivity<ActivityHomePageLayoutBind
     private void createSubjectView(String text) {
         TextView textView = (TextView) LayoutInflater.from(this).inflate(com.cooleshow.base.R.layout.view_subject_item_layout, viewBinding.llSubjectContainer, false);
         textView.setText(text);
+        textView.setTextColor(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 (viewBinding.llSubjectContainer.getChildCount() < 4) {
             if (viewBinding.llSubjectContainer.getChildCount() >= 1) {

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

@@ -115,7 +115,7 @@
             android:layout_height="wrap_content"
             android:includeFontPadding="false"
             android:paddingStart="2dp"
-            android:text="老师风采"
+            android:text="达人风采"
             android:textColor="@color/color_333333"
             android:textSize="@dimen/sp_18"
             android:textStyle="bold"