|
@@ -1,5 +1,6 @@
|
|
|
package com.cooleshow.student.ui.main
|
|
|
|
|
|
+import android.util.Log
|
|
|
import android.view.LayoutInflater
|
|
|
import android.view.MotionEvent
|
|
|
import android.view.View
|
|
@@ -12,7 +13,7 @@ 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.ui.fragment.BaseMVPFragment
|
|
|
+import com.cooleshow.usercenter.ui.activity.BaseMVPFragment
|
|
|
import com.cooleshow.base.utils.SizeUtils
|
|
|
import com.cooleshow.base.utils.TimeUtils
|
|
|
import com.cooleshow.base.widgets.EmptyViewLayout
|
|
@@ -27,6 +28,7 @@ import com.cooleshow.student.widgets.CalendarShrinkDecoration
|
|
|
import com.cooleshow.student.widgets.helper.CourseHelper
|
|
|
|
|
|
import com.haibin.calendarview.CalendarView
|
|
|
+import com.scwang.smart.refresh.layout.listener.OnRefreshListener
|
|
|
import kotlinx.android.synthetic.main.fragment_course_table_layout.*
|
|
|
import java.util.*
|
|
|
|
|
@@ -90,8 +92,11 @@ class CourseTableFragment :
|
|
|
)
|
|
|
) {
|
|
|
if (mViewBinding.calendarLayout.isExpand) {
|
|
|
+ Log.e("sdfsdgsdsdasdaf", "shrink" )
|
|
|
+
|
|
|
mViewBinding.calendarLayout.shrink()
|
|
|
} else {
|
|
|
+ Log.e("sdfsdgsdsdasdaf", "expand" )
|
|
|
mViewBinding.calendarLayout.expand()
|
|
|
}
|
|
|
return true
|
|
@@ -103,6 +108,10 @@ class CourseTableFragment :
|
|
|
})
|
|
|
adapter.setOnItemClickListener(OnItemClickListener() { adapter, view, position ->
|
|
|
})
|
|
|
+
|
|
|
+ mViewBinding.refreshLayout.setOnRefreshListener(OnRefreshListener {
|
|
|
+ queryCurrentDataCourse()
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
override fun initData() {
|
|
@@ -178,11 +187,13 @@ class CourseTableFragment :
|
|
|
if (!isMonthView) {
|
|
|
recyclerView.removeItemDecoration(calendarExpandDecoration)
|
|
|
if (recyclerView.itemDecorationCount == 0 || recyclerView.getItemDecorationAt(0) !is CalendarShrinkDecoration) {
|
|
|
+ Log.e("sdfsdgsdsdasdaf", "calendarShrinkDecoration: " )
|
|
|
recyclerView.addItemDecoration(calendarShrinkDecoration, 0)
|
|
|
}
|
|
|
} else {
|
|
|
recyclerView.removeItemDecoration(calendarShrinkDecoration)
|
|
|
if (recyclerView.itemDecorationCount == 0 || recyclerView.getItemDecorationAt(0) !is CalendarExpandDecoration) {
|
|
|
+ Log.e("sdfsdgsdsdasdaf", "calendarExpandDecoration: " )
|
|
|
recyclerView.addItemDecoration(calendarExpandDecoration, 0)
|
|
|
}
|
|
|
}
|
|
@@ -199,14 +210,19 @@ class CourseTableFragment :
|
|
|
if (isDetached) {
|
|
|
return;
|
|
|
}
|
|
|
+ mViewBinding.refreshLayout.finishRefresh()
|
|
|
if (datas?.size != 0) {
|
|
|
//更新日历表,显示有课字样
|
|
|
var maps = CourseHelper.filterDate(datas);
|
|
|
if (maps != null && maps.isNotEmpty()) {
|
|
|
+ Log.e("asdfasdfasdf", "onGetCourseDateByMonthSuccess: " )
|
|
|
mViewBinding.calendarView.addSchemeDate(maps)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ override fun onGetCourseDateByMonthError() {
|
|
|
+ mViewBinding.refreshLayout.finishRefresh()
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 查询当天的课程
|
|
@@ -227,6 +243,8 @@ class CourseTableFragment :
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
private fun showEmptyView() {
|
|
|
if (!::emptyView.isInitialized) {
|
|
|
emptyView = EmptyViewLayout(context)
|