|
@@ -1,5 +1,6 @@
|
|
|
package com.cooleshow.student.ui.main
|
|
|
|
|
|
+import android.text.TextUtils
|
|
|
import android.util.Log
|
|
|
import android.view.LayoutInflater
|
|
|
import android.view.MotionEvent
|
|
@@ -8,11 +9,14 @@ import android.widget.ImageView
|
|
|
import android.widget.TextView
|
|
|
import androidx.recyclerview.widget.LinearLayoutManager
|
|
|
import androidx.recyclerview.widget.RecyclerView
|
|
|
+import com.alibaba.android.arouter.launcher.ARouter
|
|
|
import com.bigkoo.pickerview.builder.TimePickerBuilder
|
|
|
import com.bigkoo.pickerview.listener.CustomListener
|
|
|
import com.bigkoo.pickerview.listener.OnTimeSelectListener
|
|
|
import com.bigkoo.pickerview.view.TimePickerView
|
|
|
import com.chad.library.adapter.base.listener.OnItemClickListener
|
|
|
+import com.cooleshow.base.common.WebConstants
|
|
|
+import com.cooleshow.base.router.RouterPath
|
|
|
import com.cooleshow.base.utils.SizeUtils
|
|
|
import com.cooleshow.base.utils.TimeUtils
|
|
|
import com.cooleshow.base.widgets.EmptyViewLayout
|
|
@@ -26,6 +30,7 @@ import com.cooleshow.student.widgets.CalendarExpandDecoration
|
|
|
import com.cooleshow.student.widgets.CalendarShrinkDecoration
|
|
|
import com.cooleshow.student.widgets.helper.CourseHelper
|
|
|
import com.cooleshow.base.ui.fragment.BaseMVPFragment
|
|
|
+import com.cooleshow.student.ui.course.SparringCourseDetailActivity
|
|
|
import com.haibin.calendarview.CalendarView
|
|
|
import com.scwang.smart.refresh.layout.listener.OnRefreshListener
|
|
|
import kotlinx.android.synthetic.main.fragment_course_table_layout.*
|
|
@@ -91,11 +96,11 @@ class CourseTableFragment :
|
|
|
)
|
|
|
) {
|
|
|
if (mViewBinding.calendarLayout.isExpand) {
|
|
|
- Log.e("sdfsdgsdsdasdaf", "shrink" )
|
|
|
+ Log.e("sdfsdgsdsdasdaf", "shrink")
|
|
|
|
|
|
mViewBinding.calendarLayout.shrink()
|
|
|
} else {
|
|
|
- Log.e("sdfsdgsdsdasdaf", "expand" )
|
|
|
+ Log.e("sdfsdgsdsdasdaf", "expand")
|
|
|
mViewBinding.calendarLayout.expand()
|
|
|
}
|
|
|
return true
|
|
@@ -106,12 +111,35 @@ class CourseTableFragment :
|
|
|
}
|
|
|
})
|
|
|
adapter.setOnItemClickListener(OnItemClickListener() { adapter, view, position ->
|
|
|
+ var data: CourseTableDataBean.StudentListBean =
|
|
|
+ adapter.data[position] as CourseTableDataBean.StudentListBean;
|
|
|
+ if (TextUtils.equals(CourseTableListAdapter.OTHER_COURSE, data?.courseType)) {
|
|
|
+ //陪练课
|
|
|
+ ARouter.getInstance()
|
|
|
+ .build(RouterPath.CourseCenter.SPARRING_COURSE_DETAIL)
|
|
|
+ .withString(SparringCourseDetailActivity.COURSE_ID, data.courseId)
|
|
|
+ .withString(
|
|
|
+ SparringCourseDetailActivity.COURSE_GROUP_ID,
|
|
|
+ data.courseGoupId
|
|
|
+ )
|
|
|
+ .withString(SparringCourseDetailActivity.STUDENT_ID, data.userId)
|
|
|
+ .navigation()
|
|
|
+ } else {
|
|
|
+ //直播课
|
|
|
+ ARouter.getInstance()
|
|
|
+ .build(RouterPath.WebCenter.ACTIVITY_HTML)
|
|
|
+ .withString(
|
|
|
+ WebConstants.WEB_URL,
|
|
|
+ WebConstants.TEACHER_LIVE_DETAIL + "?groupId=" + data.courseGoupId
|
|
|
+ )
|
|
|
+ .navigation()
|
|
|
+ }
|
|
|
})
|
|
|
|
|
|
mViewBinding.refreshLayout.setOnRefreshListener(OnRefreshListener {
|
|
|
queryCurrentDataCourse()
|
|
|
})
|
|
|
- mViewBinding.refreshLayout.isEnabled=false
|
|
|
+ mViewBinding.refreshLayout.isEnabled = false
|
|
|
}
|
|
|
|
|
|
override fun initData() {
|
|
@@ -160,6 +188,7 @@ class CourseTableFragment :
|
|
|
super.onResume()
|
|
|
queryCurrentDataCourse()
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 查询当前选择日期的课程
|
|
|
*/
|
|
@@ -187,16 +216,16 @@ class CourseTableFragment :
|
|
|
if (!isMonthView) {
|
|
|
recyclerView.removeItemDecoration(calendarExpandDecoration)
|
|
|
if (recyclerView.itemDecorationCount == 0 || recyclerView.getItemDecorationAt(0) !is CalendarShrinkDecoration) {
|
|
|
- Log.e("sdfsdgsdsdasdaf", "calendarShrinkDecoration: " )
|
|
|
+ Log.e("sdfsdgsdsdasdaf", "calendarShrinkDecoration: ")
|
|
|
recyclerView.addItemDecoration(calendarShrinkDecoration, 0)
|
|
|
- mViewBinding.refreshLayout.isEnabled=false
|
|
|
+ mViewBinding.refreshLayout.isEnabled = false
|
|
|
}
|
|
|
} else {
|
|
|
recyclerView.removeItemDecoration(calendarShrinkDecoration)
|
|
|
if (recyclerView.itemDecorationCount == 0 || recyclerView.getItemDecorationAt(0) !is CalendarExpandDecoration) {
|
|
|
- Log.e("sdfsdgsdsdasdaf", "calendarExpandDecoration: " )
|
|
|
+ Log.e("sdfsdgsdsdasdaf", "calendarExpandDecoration: ")
|
|
|
recyclerView.addItemDecoration(calendarExpandDecoration, 0)
|
|
|
- mViewBinding.refreshLayout.isEnabled=true
|
|
|
+ mViewBinding.refreshLayout.isEnabled = true
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -217,12 +246,13 @@ class CourseTableFragment :
|
|
|
//更新日历表,显示有课字样
|
|
|
var maps = CourseHelper.filterDate(datas);
|
|
|
if (maps != null && maps.isNotEmpty()) {
|
|
|
- Log.e("asdfasdfasdf", "onGetCourseDateByMonthSuccess: " )
|
|
|
+ Log.e("asdfasdfasdf", "onGetCourseDateByMonthSuccess: ")
|
|
|
mViewBinding.calendarView.clearSchemeDate()
|
|
|
mViewBinding.calendarView.addSchemeDate(maps)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
override fun onGetCourseDateByMonthError() {
|
|
|
mViewBinding.refreshLayout.finishRefresh()
|
|
|
}
|
|
@@ -247,7 +277,6 @@ class CourseTableFragment :
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
private fun showEmptyView() {
|
|
|
if (!::emptyView.isInitialized) {
|
|
|
emptyView = EmptyViewLayout(context)
|