Commit 10be927b by “leiyan”

1、赛果增加日期选择查询

parent 7d6e37d4
......@@ -75,11 +75,12 @@ class MatchContentFragment : RefreshVP2Fragment<MatchContentPresenter>(),
startActivity(intent)
}
}
if (currentPosition == 2) {
if (currentPosition == 2 || currentPosition == 3) {
val head = View.inflate(requireContext(), R.layout.layout_schedule_head, null)
contentAdapter.addHeaderView(head)
head.findViewById<RecyclerView>(R.id.recycler_schedule_head).apply {
adapter = ScheduleAdapter().apply {
if(currentPosition == 2) {
setNewData(mutableListOf<ScheduleEntity>()
.apply {
add(
......@@ -135,6 +136,62 @@ class MatchContentFragment : RefreshVP2Fragment<MatchContentPresenter>(),
)
})
} else if(currentPosition == 3){
setNewData(mutableListOf<ScheduleEntity>()
.apply {
add(
ScheduleEntity(
CommonUtils.getAppointDateMd(-6),
CommonUtils.getCalendarWeek(CommonUtils.getAppointDate(-6)),
CommonUtils.getAppointDate(-6)
)
)
add(
ScheduleEntity(
CommonUtils.getAppointDateMd(-5),
CommonUtils.getCalendarWeek(CommonUtils.getAppointDate(-5)),
CommonUtils.getAppointDate(-5)
)
)
add(
ScheduleEntity(
CommonUtils.getAppointDateMd(-4),
CommonUtils.getCalendarWeek(CommonUtils.getAppointDate(-4)),
CommonUtils.getAppointDate(-4)
)
)
add(
ScheduleEntity(
CommonUtils.getAppointDateMd(-3),
CommonUtils.getCalendarWeek(CommonUtils.getAppointDate(-3)),
CommonUtils.getAppointDate(-3)
)
)
add(
ScheduleEntity(
CommonUtils.getAppointDateMd(-2),
CommonUtils.getCalendarWeek(CommonUtils.getAppointDate(-2)),
CommonUtils.getAppointDate(-2)
)
)
add(
ScheduleEntity(
CommonUtils.getAppointDateMd(-1),
CommonUtils.getCalendarWeek(CommonUtils.getAppointDate(-1)),
CommonUtils.getAppointDate(-1)
)
)
add(
ScheduleEntity(
CommonUtils.getAppointDateMd(0),
CommonUtils.getCalendarWeek(CommonUtils.getAppointDate(0)),
CommonUtils.getAppointDate(0),
true,
true
)
)
})
}
setOnItemClickListener { adapter, view, position ->
adapter.data.forEach {
it as ScheduleEntity
......@@ -143,6 +200,7 @@ class MatchContentFragment : RefreshVP2Fragment<MatchContentPresenter>(),
val item = adapter.getItem(position) as ScheduleEntity
item.isSelected = true
adapter.notifyItemRangeChanged(0,adapter.itemCount)
mPage = 1
presenter?.getMatchList(sportId,sportType,item.wholeTime,mPage,PAGE_COUNT)
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment