|
@@ -1,6 +1,7 @@
|
|
package com.cooleshow.teacher.ui.score;
|
|
package com.cooleshow.teacher.ui.score;
|
|
|
|
|
|
import android.os.Bundle;
|
|
import android.os.Bundle;
|
|
|
|
+import android.os.StrictMode;
|
|
import android.text.TextUtils;
|
|
import android.text.TextUtils;
|
|
import android.view.LayoutInflater;
|
|
import android.view.LayoutInflater;
|
|
import android.view.View;
|
|
import android.view.View;
|
|
@@ -37,6 +38,10 @@ import java.util.List;
|
|
* 类说明:
|
|
* 类说明:
|
|
*/
|
|
*/
|
|
public class MineScoreFragment extends BaseMVPFragment<FragmentMineScoreBinding, MineScorePresenter> implements MineScoreContract.MineScoreView, View.OnClickListener {
|
|
public class MineScoreFragment extends BaseMVPFragment<FragmentMineScoreBinding, MineScorePresenter> implements MineScoreContract.MineScoreView, View.OnClickListener {
|
|
|
|
+ private String auditStatus = "";
|
|
|
|
+ private String musicianAuthStatus = "";
|
|
|
|
+ private MineScoreAdapter mineScoreAdapter;
|
|
|
|
+ List<MusicSheetListBean.RowsBean> dataList = new ArrayList<>();
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void onClick(View view) {
|
|
public void onClick(View view) {
|
|
@@ -47,11 +52,11 @@ public class MineScoreFragment extends BaseMVPFragment<FragmentMineScoreBinding,
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- public static MineScoreFragment newInstance(String auditStatus,String musicianAuthStatus) {
|
|
|
|
|
|
+ public static MineScoreFragment newInstance(String auditStatus, String musicianAuthStatus) {
|
|
Bundle args = new Bundle();
|
|
Bundle args = new Bundle();
|
|
MineScoreFragment fragment = new MineScoreFragment();
|
|
MineScoreFragment fragment = new MineScoreFragment();
|
|
args.putString("auditStatus", auditStatus);
|
|
args.putString("auditStatus", auditStatus);
|
|
- args.putString("musicianAuthStatus",musicianAuthStatus);
|
|
|
|
|
|
+ args.putString("musicianAuthStatus", musicianAuthStatus);
|
|
fragment.setArguments(args);
|
|
fragment.setArguments(args);
|
|
return fragment;
|
|
return fragment;
|
|
}
|
|
}
|
|
@@ -66,15 +71,10 @@ public class MineScoreFragment extends BaseMVPFragment<FragmentMineScoreBinding,
|
|
return new MineScorePresenter();
|
|
return new MineScorePresenter();
|
|
}
|
|
}
|
|
|
|
|
|
- private String auditStatus = "";
|
|
|
|
- private String musicianAuthStatus="";
|
|
|
|
- private MineScoreAdapter mineScoreAdapter;
|
|
|
|
- List<MusicSheetListBean.RowsBean> dataList = new ArrayList<>();
|
|
|
|
-
|
|
|
|
@Override
|
|
@Override
|
|
protected void initView(View rootView) {
|
|
protected void initView(View rootView) {
|
|
auditStatus = getArguments().getString("auditStatus");
|
|
auditStatus = getArguments().getString("auditStatus");
|
|
- musicianAuthStatus=getArguments().getString("musicianAuthStatus");
|
|
|
|
|
|
+ musicianAuthStatus = getArguments().getString("musicianAuthStatus");
|
|
RecyclerView rvAddress = mViewBinding.recyclerView;
|
|
RecyclerView rvAddress = mViewBinding.recyclerView;
|
|
mViewBinding.llUploadScore.setOnClickListener(this);
|
|
mViewBinding.llUploadScore.setOnClickListener(this);
|
|
LinearLayoutManager manager = new LinearLayoutManager(getContext());
|
|
LinearLayoutManager manager = new LinearLayoutManager(getContext());
|
|
@@ -82,13 +82,13 @@ public class MineScoreFragment extends BaseMVPFragment<FragmentMineScoreBinding,
|
|
mineScoreAdapter = new MineScoreAdapter(dataList);
|
|
mineScoreAdapter = new MineScoreAdapter(dataList);
|
|
LayoutInflater inflater = LayoutInflater.from(getContext());
|
|
LayoutInflater inflater = LayoutInflater.from(getContext());
|
|
View emptyLayout = inflater.inflate(R.layout.layout_empty_conent, null);
|
|
View emptyLayout = inflater.inflate(R.layout.layout_empty_conent, null);
|
|
- ImageView im_empty_logo=emptyLayout.findViewById(R.id.im_empty_logo);
|
|
|
|
- im_empty_logo.setBackgroundResource(R.drawable.icon_empty_score);
|
|
|
|
- TextView tv_empty_hint=emptyLayout.findViewById(R.id.tv_empty_hint);
|
|
|
|
- tv_empty_hint.setText("暂无收藏~");
|
|
|
|
|
|
+ ImageView im_empty_logo = emptyLayout.findViewById(R.id.im_empty_logo);
|
|
|
|
+ im_empty_logo.setBackgroundResource(R.drawable.icon_empty_content);
|
|
|
|
+ TextView tv_empty_hint = emptyLayout.findViewById(R.id.tv_empty_hint);
|
|
|
|
+ tv_empty_hint.setText("暂无曲谱~");
|
|
mineScoreAdapter.setEmptyView(emptyLayout);
|
|
mineScoreAdapter.setEmptyView(emptyLayout);
|
|
rvAddress.setAdapter(mineScoreAdapter);
|
|
rvAddress.setAdapter(mineScoreAdapter);
|
|
- switch (musicianAuthStatus){
|
|
|
|
|
|
+ switch (musicianAuthStatus) {
|
|
case TeacherInfoConstants.MUSICIAN_STATUS_PASS:
|
|
case TeacherInfoConstants.MUSICIAN_STATUS_PASS:
|
|
mViewBinding.llContent.setVisibility(View.VISIBLE);
|
|
mViewBinding.llContent.setVisibility(View.VISIBLE);
|
|
mViewBinding.clEmpty.setVisibility(View.GONE);
|
|
mViewBinding.clEmpty.setVisibility(View.GONE);
|
|
@@ -97,24 +97,26 @@ public class MineScoreFragment extends BaseMVPFragment<FragmentMineScoreBinding,
|
|
mViewBinding.llContent.setVisibility(View.GONE);
|
|
mViewBinding.llContent.setVisibility(View.GONE);
|
|
mViewBinding.clEmpty.setVisibility(View.VISIBLE);
|
|
mViewBinding.clEmpty.setVisibility(View.VISIBLE);
|
|
mViewBinding.tvEmptyHint.setText("您已提交认证申请\n清耐心等待审核结果~");
|
|
mViewBinding.tvEmptyHint.setText("您已提交认证申请\n清耐心等待审核结果~");
|
|
|
|
+ mViewBinding.gotoVerifyBtn.setVisibility(View.GONE);
|
|
break;
|
|
break;
|
|
case TeacherInfoConstants.MUSICIAN_STATUS_UNPAALY:
|
|
case TeacherInfoConstants.MUSICIAN_STATUS_UNPAALY:
|
|
mViewBinding.llContent.setVisibility(View.GONE);
|
|
mViewBinding.llContent.setVisibility(View.GONE);
|
|
mViewBinding.clEmpty.setVisibility(View.VISIBLE);
|
|
mViewBinding.clEmpty.setVisibility(View.VISIBLE);
|
|
mViewBinding.tvEmptyHint.setText("您还未提交认证申请");
|
|
mViewBinding.tvEmptyHint.setText("您还未提交认证申请");
|
|
|
|
+ mViewBinding.gotoVerifyBtn.setVisibility(View.VISIBLE);
|
|
break;
|
|
break;
|
|
case TeacherInfoConstants.MUSICIAN_STATUS_UNPASS:
|
|
case TeacherInfoConstants.MUSICIAN_STATUS_UNPASS:
|
|
mViewBinding.llContent.setVisibility(View.GONE);
|
|
mViewBinding.llContent.setVisibility(View.GONE);
|
|
mViewBinding.clEmpty.setVisibility(View.VISIBLE);
|
|
mViewBinding.clEmpty.setVisibility(View.VISIBLE);
|
|
- mViewBinding.tvEmptyHint.setText("您已提交认证申请未通过\n清重新提交~");
|
|
|
|
|
|
+ mViewBinding.tvEmptyHint.setText("您已提交认证申请未通过\n请重新提交~");
|
|
|
|
+ mViewBinding.gotoVerifyBtn.setVisibility(View.VISIBLE);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
+ mViewBinding.gotoVerifyBtn.setOnClickListener(v -> {
|
|
|
|
+ WebStartHelper.startMusicPersonCertPage();
|
|
|
|
+ });
|
|
|
|
+ mineScoreAdapter.setOnItemClickListener((adapter, view, position) -> {
|
|
|
|
|
|
- mineScoreAdapter.setOnItemClickListener(new OnItemClickListener() {
|
|
|
|
- @Override
|
|
|
|
- public void onItemClick(@NonNull BaseQuickAdapter<?, ?> adapter, @NonNull View view, int position) {
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
});
|
|
});
|
|
|
|
|
|
}
|
|
}
|
|
@@ -123,23 +125,17 @@ public class MineScoreFragment extends BaseMVPFragment<FragmentMineScoreBinding,
|
|
|
|
|
|
@Override
|
|
@Override
|
|
protected void initData() {
|
|
protected void initData() {
|
|
- mViewBinding.refreshLayout.setOnRefreshListener(new OnRefreshListener() {
|
|
|
|
- @Override
|
|
|
|
- public void onRefresh(@NonNull RefreshLayout refreshLayout) {
|
|
|
|
- currentPage = 1;
|
|
|
|
- queryScore(true);
|
|
|
|
- }
|
|
|
|
|
|
+ mViewBinding.refreshLayout.setOnRefreshListener(refreshLayout -> {
|
|
|
|
+ currentPage = 1;
|
|
|
|
+ queryScore(true);
|
|
});
|
|
});
|
|
- mineScoreAdapter.getLoadMoreModule().setOnLoadMoreListener(new OnLoadMoreListener() {
|
|
|
|
- @Override
|
|
|
|
- public void onLoadMore() {
|
|
|
|
- //上拉加载
|
|
|
|
- if (hasNext) {
|
|
|
|
- currentPage++;
|
|
|
|
- queryScore(false);
|
|
|
|
- } else {
|
|
|
|
- mineScoreAdapter.getLoadMoreModule().loadMoreEnd();
|
|
|
|
- }
|
|
|
|
|
|
+ mineScoreAdapter.getLoadMoreModule().setOnLoadMoreListener(() -> {
|
|
|
|
+ //上拉加载
|
|
|
|
+ if (hasNext) {
|
|
|
|
+ currentPage++;
|
|
|
|
+ queryScore(false);
|
|
|
|
+ } else {
|
|
|
|
+ mineScoreAdapter.getLoadMoreModule().loadMoreEnd();
|
|
}
|
|
}
|
|
});
|
|
});
|
|
currentPage = 1;
|
|
currentPage = 1;
|