|
@@ -32,6 +32,8 @@ import com.cooleshow.base.utils.PopupUtil;
|
|
import com.cooleshow.base.utils.TimeUtils;
|
|
import com.cooleshow.base.utils.TimeUtils;
|
|
import com.cooleshow.base.widgets.EmptyViewLayout;
|
|
import com.cooleshow.base.widgets.EmptyViewLayout;
|
|
|
|
|
|
|
|
+import com.cooleshow.base.widgets.poplist.PopMenuBean;
|
|
|
|
+import com.cooleshow.base.widgets.poplist.PopupListWindow;
|
|
import com.cooleshow.student.R;
|
|
import com.cooleshow.student.R;
|
|
import com.cooleshow.student.adapter.CourseStatusFilterAdapter;
|
|
import com.cooleshow.student.adapter.CourseStatusFilterAdapter;
|
|
import com.cooleshow.student.adapter.LiveCourseListAdapter;
|
|
import com.cooleshow.student.adapter.LiveCourseListAdapter;
|
|
@@ -61,12 +63,9 @@ public class LiveCourseFragment extends BaseMVPFragment<FragmentLiveCourseLayout
|
|
private int currentPage;
|
|
private int currentPage;
|
|
private LiveCourseListAdapter mAdapter;
|
|
private LiveCourseListAdapter mAdapter;
|
|
private EmptyViewLayout mEmptyView;
|
|
private EmptyViewLayout mEmptyView;
|
|
- private TextView mTvEmptyTip;
|
|
|
|
- private ImageView mEmptyIcon;
|
|
|
|
private TimePickerView pvTime;
|
|
private TimePickerView pvTime;
|
|
- private PopupWindow mPopupWindow;
|
|
|
|
private ArrayList<CourseFilterStatusBean> mCourseFilterStatusBeans;
|
|
private ArrayList<CourseFilterStatusBean> mCourseFilterStatusBeans;
|
|
- private CourseStatusFilterAdapter mCourseStatusFilterAdapter;
|
|
|
|
|
|
+ private List<QuerySubjectBean> subjectBeanList = new ArrayList<>();
|
|
private boolean hasNext = true;
|
|
private boolean hasNext = true;
|
|
private boolean isFirstLoad = true;
|
|
private boolean isFirstLoad = true;
|
|
|
|
|
|
@@ -261,38 +260,6 @@ public class LiveCourseFragment extends BaseMVPFragment<FragmentLiveCourseLayout
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- private void initPopu(View targetView) {
|
|
|
|
- if (mPopupWindow == null) {
|
|
|
|
- View popupContentView = LayoutInflater.from(requireContext()).inflate(com.cooleshow.base.R.layout.list_popu_layout, null);
|
|
|
|
- RecyclerView recyclerView = popupContentView.findViewById(R.id.recyclerView);
|
|
|
|
- View bg = popupContentView.findViewById(com.cooleshow.base.R.id.view);
|
|
|
|
- bg.setOnClickListener(v -> {
|
|
|
|
- if (mPopupWindow != null) {
|
|
|
|
- mPopupWindow.dismiss();
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- mCourseStatusFilterAdapter = new CourseStatusFilterAdapter(com.cooleshow.base.R.layout.notice_popu_list_item);
|
|
|
|
- mCourseStatusFilterAdapter.setOnItemClickListener((adapter, view, position) -> {
|
|
|
|
- Object object = mCourseStatusFilterAdapter.getData().get(position);
|
|
|
|
- if (object instanceof CourseFilterStatusBean) {
|
|
|
|
- if (mCourseStatusFilterAdapter != null) {
|
|
|
|
- mCourseStatusFilterAdapter.setSelect(position);
|
|
|
|
- }
|
|
|
|
- CourseFilterStatusBean filterStatusBean = (CourseFilterStatusBean) object;
|
|
|
|
- mViewBinding.tvCourseStatus.setText(filterStatusBean.showText);
|
|
|
|
- reBuildFilter(currentSelectDate, filterStatusBean.value);
|
|
|
|
- }
|
|
|
|
- mPopupWindow.dismiss();
|
|
|
|
- });
|
|
|
|
- recyclerView.setLayoutManager(new LinearLayoutManager(requireContext()));
|
|
|
|
- recyclerView.setAdapter(mCourseStatusFilterAdapter);
|
|
|
|
- mCourseStatusFilterAdapter.setNewInstance(mCourseFilterStatusBeans);
|
|
|
|
- mPopupWindow = PopupUtil.createNoBackPopupWindow(popupContentView, requireContext(), ViewGroup.LayoutParams.MATCH_PARENT,
|
|
|
|
- ViewGroup.LayoutParams.WRAP_CONTENT, true);
|
|
|
|
- }
|
|
|
|
- mPopupWindow.showAsDropDown(targetView);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
@Override
|
|
@Override
|
|
public void onClick(View v) {
|
|
public void onClick(View v) {
|
|
if (v.getId() == R.id.tv_time) {
|
|
if (v.getId() == R.id.tv_time) {
|
|
@@ -303,18 +270,46 @@ public class LiveCourseFragment extends BaseMVPFragment<FragmentLiveCourseLayout
|
|
|
|
|
|
if (v.getId() == R.id.tv_course_status) {
|
|
if (v.getId() == R.id.tv_course_status) {
|
|
//课程状态筛选
|
|
//课程状态筛选
|
|
- initPopu(mViewBinding.tvCourseStatus);
|
|
|
|
|
|
+ List<PopMenuBean> popList = new ArrayList<>();
|
|
|
|
+ for (CourseFilterStatusBean bean : mCourseFilterStatusBeans) {
|
|
|
|
+ PopMenuBean popMenuBean = new PopMenuBean();
|
|
|
|
+ popMenuBean.setActionName(bean.showText);
|
|
|
|
+ popList.add(popMenuBean);
|
|
|
|
+ }
|
|
|
|
+ initCoursePop(mViewBinding.tvCourseStatus, popList, position -> {
|
|
|
|
+ CourseFilterStatusBean bean = mCourseFilterStatusBeans.get(position);
|
|
|
|
+ mViewBinding.tvCourseStatus.setText(bean.showText);
|
|
|
|
+ reBuildFilter(currentSelectDate, bean.value);
|
|
|
|
+ });
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
if (v.getId() == R.id.tv_agency) {
|
|
if (v.getId() == R.id.tv_agency) {
|
|
//选择声部
|
|
//选择声部
|
|
- selectSubject();
|
|
|
|
|
|
+ if (subjectBeanList.size() == 0) {
|
|
|
|
+ subjectBeanList.add(new QuerySubjectBean("全部声部", 0));
|
|
|
|
+ }
|
|
|
|
+ List<PopMenuBean> popList = new ArrayList<>();
|
|
|
|
+ for (QuerySubjectBean bean : subjectBeanList) {
|
|
|
|
+ PopMenuBean popMenuBean = new PopMenuBean();
|
|
|
|
+ popMenuBean.setActionName(bean.name);
|
|
|
|
+ popList.add(popMenuBean);
|
|
|
|
+ }
|
|
|
|
+ initCoursePop(mViewBinding.tvCourseStatus, popList, position -> {
|
|
|
|
+ QuerySubjectBean bean = subjectBeanList.get(position);
|
|
|
|
+ currentSubjectId = bean.id;
|
|
|
|
+ mViewBinding.tvAgency.setText(bean.name);
|
|
|
|
+ queryCourse(true);
|
|
|
|
+ });
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- private List<QuerySubjectBean> subjectBeanList = new ArrayList<>();
|
|
|
|
|
|
+
|
|
|
|
+ private void initCoursePop(View targetView, List<PopMenuBean> popList, PopupListWindow.PopupListListener listener) {
|
|
|
|
+ PopupListWindow popWindow = new PopupListWindow(getContext());
|
|
|
|
+ popWindow.showListPop(targetView, popList, position -> listener.onPopupListClick(position));
|
|
|
|
+ }
|
|
|
|
|
|
public void querySubjectItemSuccess(List<QuerySubjectBean> data) {
|
|
public void querySubjectItemSuccess(List<QuerySubjectBean> data) {
|
|
subjectBeanList.clear();
|
|
subjectBeanList.clear();
|