|
@@ -41,6 +41,7 @@ import com.cooleshow.student.adapter.HomeVideoCourseAdapter;
|
|
|
import com.cooleshow.student.adapter.HomeWonderfulInfoAdapter;
|
|
|
import com.cooleshow.student.bean.AppHomeBean;
|
|
|
import com.cooleshow.student.bean.CountOfUnreadBean;
|
|
|
+import com.cooleshow.student.bean.HelpCenterContentBean;
|
|
|
import com.cooleshow.student.bean.HomeLiveAndVideoBean;
|
|
|
import com.cooleshow.student.bean.HomeStyleBean;
|
|
|
import com.cooleshow.student.bean.HotAlbumBean;
|
|
@@ -72,7 +73,8 @@ import java.util.TreeMap;
|
|
|
* 类说明:
|
|
|
*/
|
|
|
public class HomeFragment extends BaseMVPFragment<FragmentHomeLayoutBinding, HomePresenter> implements HomeContract.HomeView, View.OnClickListener {
|
|
|
- private boolean isShowFlashPage;
|
|
|
+ private boolean isShowFlashPage =false;
|
|
|
+ private String mCurrentShowNoticeId;
|
|
|
|
|
|
@Override
|
|
|
public void onClick(View view) {
|
|
@@ -126,8 +128,16 @@ public class HomeFragment extends BaseMVPFragment<FragmentHomeLayoutBinding, Hom
|
|
|
.withString(WebConstants.WEB_URL, WebConstants.STUDENT_TEACHER_ELEGANT)
|
|
|
.navigation();
|
|
|
break;
|
|
|
-
|
|
|
-
|
|
|
+ case R.id.bg_announcement:
|
|
|
+ if (TextUtils.isEmpty(mCurrentShowNoticeId)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //点击单条公告
|
|
|
+ ARouter.getInstance()
|
|
|
+ .build(RouterPath.WebCenter.ACTIVITY_HTML)
|
|
|
+ .withString(WebConstants.WEB_URL, WebConstants.HELP_CENTER_DETAIL + mCurrentShowNoticeId)
|
|
|
+ .navigation();
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -136,6 +146,7 @@ public class HomeFragment extends BaseMVPFragment<FragmentHomeLayoutBinding, Hom
|
|
|
super.onResume();
|
|
|
presenter.queryCountOfUnread();
|
|
|
presenter.queryUserInfo();
|
|
|
+ presenter.helpCenterContentList();
|
|
|
presenter.queryLiveAndVideo();
|
|
|
}
|
|
|
|
|
@@ -169,6 +180,7 @@ public class HomeFragment extends BaseMVPFragment<FragmentHomeLayoutBinding, Hom
|
|
|
mViewBinding.imTeacherStyleMore.setOnClickListener(this);
|
|
|
mViewBinding.tvName.setOnClickListener(this);
|
|
|
mViewBinding.ivAvatar.setOnClickListener(this);
|
|
|
+ mViewBinding.bgAnnouncement.setOnClickListener(this);
|
|
|
|
|
|
mViewBinding.scrollLayout.setOnScrollChangeListener((NestedScrollView.OnScrollChangeListener) (v, scrollX, scrollY, oldScrollX, oldScrollY) -> {
|
|
|
boolean localVisibleRect = getLocalVisibleRect(getActivity(), banner, 10);
|
|
@@ -333,6 +345,21 @@ public class HomeFragment extends BaseMVPFragment<FragmentHomeLayoutBinding, Hom
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void helpCenterContentListSuccess(HelpCenterContentBean bean) {
|
|
|
+ if (isDetached()) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (bean != null && bean.rows != null && bean.rows.size() > 0) {
|
|
|
+ mViewBinding.bgAnnouncement.setVisibility(View.VISIBLE);
|
|
|
+ HelpCenterContentBean.RowsBean rowsBean = bean.rows.get(0);
|
|
|
+ mViewBinding.tvNoticeContent.setText(rowsBean.title);
|
|
|
+ mCurrentShowNoticeId = rowsBean.id;
|
|
|
+ } else {
|
|
|
+ mViewBinding.bgAnnouncement.setVisibility(View.GONE);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
@SuppressLint("SetTextI18n")
|
|
|
private void initRecentLive(HomeLiveAndVideoBean.RecentCoursesBean recentCourses) {
|
|
@@ -366,7 +393,7 @@ public class HomeFragment extends BaseMVPFragment<FragmentHomeLayoutBinding, Hom
|
|
|
case LIVE_COURSE:
|
|
|
ARouter.getInstance()
|
|
|
.build(RouterPath.WebCenter.ACTIVITY_HTML)
|
|
|
- .withString(WebConstants.WEB_URL, WebConstants.TEACHER_LIVE_DETAIL + "?groupId=" + bean.courseGroupId)
|
|
|
+ .withString(WebConstants.WEB_URL, WebConstants.TEACHER_LIVE_DETAIL + "?groupId=" + bean.courseGroupId + "&classId=" + bean.courseId)
|
|
|
.navigation();
|
|
|
break;
|
|
|
case OTHER_COURSE:
|