|
@@ -1,16 +1,20 @@
|
|
|
package com.cooleshow.institution.stu.ui.main;
|
|
|
|
|
|
+import android.os.Bundle;
|
|
|
import android.text.TextUtils;
|
|
|
import android.view.View;
|
|
|
|
|
|
import com.alibaba.android.arouter.launcher.ARouter;
|
|
|
import com.bumptech.glide.Glide;
|
|
|
+import com.cooleshow.base.bean.TeachableInstrumentBean;
|
|
|
import com.cooleshow.base.common.WebConstants;
|
|
|
import com.cooleshow.base.router.RouterPath;
|
|
|
import com.cooleshow.base.ui.activity.BaseMVPActivity;
|
|
|
import com.cooleshow.base.ui.fragment.BaseMVPFragment;
|
|
|
import com.cooleshow.base.utils.SizeUtils;
|
|
|
+import com.cooleshow.base.utils.UiUtils;
|
|
|
import com.cooleshow.base.utils.Utils;
|
|
|
+import com.cooleshow.base.utils.helper.WebStartHelper;
|
|
|
import com.cooleshow.institution.stu.R;
|
|
|
import com.cooleshow.institution.stu.adapter.HomeHotAlbumAdapter;
|
|
|
import com.cooleshow.institution.stu.adapter.HomeHotMusicSheetAdapter;
|
|
@@ -21,6 +25,7 @@ import com.cooleshow.institution.stu.bean.HomePageMode;
|
|
|
import com.cooleshow.institution.stu.bean.HotAlbumBean;
|
|
|
import com.cooleshow.institution.stu.constants.Constants;
|
|
|
import com.cooleshow.institution.stu.constants.JGWebConstants;
|
|
|
+import com.cooleshow.institution.stu.constants.JGWebStartHelper;
|
|
|
import com.cooleshow.institution.stu.contract.HomeMusicContract;
|
|
|
import com.cooleshow.institution.stu.databinding.FgHomeMusicLayoutBinding;
|
|
|
import com.cooleshow.institution.stu.presenter.HomeMusicPresenter;
|
|
@@ -35,6 +40,7 @@ import com.youth.banner.holder.BannerImageHolder;
|
|
|
import com.youth.banner.indicator.RectangleIndicator;
|
|
|
import com.youth.banner.listener.OnBannerListener;
|
|
|
|
|
|
+import java.io.Serializable;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
@@ -54,6 +60,8 @@ public class HomeMusicFragment extends BaseMVPFragment<FgHomeMusicLayoutBinding,
|
|
|
private HomeHotMusicSheetAdapter mHomeHotMusicSheetAdapter;
|
|
|
private BannerImageAdapter mBannerImageAdapter;
|
|
|
|
|
|
+ private StudentUserInfo mUserInfo;
|
|
|
+
|
|
|
private ArrayList<AppHomeBean.ItemBean> itemBeans = new ArrayList<>();
|
|
|
|
|
|
@Override
|
|
@@ -131,7 +139,13 @@ public class HomeMusicFragment extends BaseMVPFragment<FgHomeMusicLayoutBinding,
|
|
|
}
|
|
|
|
|
|
private void initListener() {
|
|
|
+ mViewBinding.tvSubject.setOnClickListener(this);
|
|
|
mViewBinding.ivPractice.setOnClickListener(this);
|
|
|
+ mViewBinding.viewSearchBg.setOnClickListener(this);
|
|
|
+ mViewBinding.tvHotAlbumMore.setOnClickListener(this);
|
|
|
+ mViewBinding.tvHotTrackMore.setOnClickListener(this);
|
|
|
+ mViewBinding.tvRecommendTrackMore.setOnClickListener(this);
|
|
|
+ mViewBinding.tvLatestTrackMore.setOnClickListener(this);
|
|
|
mViewBinding.refreshLayout.setOnRefreshListener(new OnRefreshListener() {
|
|
|
@Override
|
|
|
public void onRefresh(@NonNull RefreshLayout refreshLayout) {
|
|
@@ -183,6 +197,68 @@ public class HomeMusicFragment extends BaseMVPFragment<FgHomeMusicLayoutBinding,
|
|
|
mHomeViewModel.getHomePageModeEvent().postValue(new HomePageMode(Constants.PRACTICE_TUTORIALS));
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
+ if (id == R.id.tv_subject) {
|
|
|
+ goSelectSubject();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (id == R.id.view_search_bg) {
|
|
|
+ JGWebStartHelper.startSearch();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (id == R.id.tv_hot_track_more) {
|
|
|
+ if (UiUtils.isFastClick()) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //热门曲目更多
|
|
|
+ JGWebStartHelper.startHotMusicSheetList();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (id == R.id.tv_recommend_track_more) {
|
|
|
+ if (UiUtils.isFastClick()) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //推荐曲目 最新曲目更多
|
|
|
+ JGWebStartHelper.startHotMusicSheetList();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (id == R.id.tv_latest_track_more) {
|
|
|
+ if (UiUtils.isFastClick()) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //推荐曲目 最新曲目更多
|
|
|
+ JGWebStartHelper.startHotMusicSheetList();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (id == R.id.tv_hot_album_more) {
|
|
|
+ if (UiUtils.isFastClick()) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ JGWebStartHelper.startHotAlbumMore();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void goSelectSubject() {
|
|
|
+ if (mUserInfo == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ Bundle bundle = new Bundle();
|
|
|
+ TeachableInstrumentBean teachableInstrumentBean = new TeachableInstrumentBean();
|
|
|
+ teachableInstrumentBean.id = Long.parseLong(mUserInfo.subjectId);
|
|
|
+ teachableInstrumentBean.name = mUserInfo.subjectName;
|
|
|
+ bundle.putSerializable("selectTeachableInstrument", (Serializable) teachableInstrumentBean);
|
|
|
+ ARouter.getInstance().build(RouterPath.MineCenter.MINE_TEACHABLE_INSTRUMENT)
|
|
|
+ .withBundle("bundle", bundle)
|
|
|
+ .navigation();
|
|
|
+ } catch (Exception e) {
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -294,7 +370,10 @@ public class HomeMusicFragment extends BaseMVPFragment<FgHomeMusicLayoutBinding,
|
|
|
|
|
|
public void refreshUserInfo(StudentUserInfo data) {
|
|
|
if (data != null) {
|
|
|
+ this.mUserInfo = data;
|
|
|
mViewBinding.tvName.setText(data.getTenantName());
|
|
|
+ mViewBinding.tvSubject.setText(data.subjectName);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
}
|