Commit 10be927b by “leiyan”

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

parent 7d6e37d4
...@@ -75,66 +75,123 @@ class MatchContentFragment : RefreshVP2Fragment<MatchContentPresenter>(), ...@@ -75,66 +75,123 @@ class MatchContentFragment : RefreshVP2Fragment<MatchContentPresenter>(),
startActivity(intent) startActivity(intent)
} }
} }
if (currentPosition == 2) { if (currentPosition == 2 || currentPosition == 3) {
val head = View.inflate(requireContext(), R.layout.layout_schedule_head, null) val head = View.inflate(requireContext(), R.layout.layout_schedule_head, null)
contentAdapter.addHeaderView(head) contentAdapter.addHeaderView(head)
head.findViewById<RecyclerView>(R.id.recycler_schedule_head).apply { head.findViewById<RecyclerView>(R.id.recycler_schedule_head).apply {
adapter = ScheduleAdapter().apply { adapter = ScheduleAdapter().apply {
setNewData(mutableListOf<ScheduleEntity>() if(currentPosition == 2) {
.apply { setNewData(mutableListOf<ScheduleEntity>()
add( .apply {
ScheduleEntity( add(
CommonUtils.getAppointDateMd(0), ScheduleEntity(
CommonUtils.getCalendarWeek(CommonUtils.getAppointDate(0)), CommonUtils.getAppointDateMd(0),
CommonUtils.getAppointDate(0), CommonUtils.getCalendarWeek(CommonUtils.getAppointDate(0)),
true, CommonUtils.getAppointDate(0),
true true,
true
)
) )
) add(
add( ScheduleEntity(
ScheduleEntity( CommonUtils.getAppointDateMd(1),
CommonUtils.getAppointDateMd(1), CommonUtils.getCalendarWeek(CommonUtils.getAppointDate(1)),
CommonUtils.getCalendarWeek(CommonUtils.getAppointDate(1)), CommonUtils.getAppointDate(1)
CommonUtils.getAppointDate(1) )
) )
) add(
add( ScheduleEntity(
ScheduleEntity( CommonUtils.getAppointDateMd(2),
CommonUtils.getAppointDateMd(2), CommonUtils.getCalendarWeek(CommonUtils.getAppointDate(2)),
CommonUtils.getCalendarWeek(CommonUtils.getAppointDate(2)), CommonUtils.getAppointDate(2)
CommonUtils.getAppointDate(2) )
) )
) add(
add( ScheduleEntity(
ScheduleEntity( CommonUtils.getAppointDateMd(3),
CommonUtils.getAppointDateMd(3), CommonUtils.getCalendarWeek(CommonUtils.getAppointDate(3)),
CommonUtils.getCalendarWeek(CommonUtils.getAppointDate(3)), CommonUtils.getAppointDate(3)
CommonUtils.getAppointDate(3) )
) )
) add(
add( ScheduleEntity(
ScheduleEntity( CommonUtils.getAppointDateMd(4),
CommonUtils.getAppointDateMd(4), CommonUtils.getCalendarWeek(CommonUtils.getAppointDate(4)),
CommonUtils.getCalendarWeek(CommonUtils.getAppointDate(4)), CommonUtils.getAppointDate(4)
CommonUtils.getAppointDate(4) )
) )
) add(
add( ScheduleEntity(
ScheduleEntity( CommonUtils.getAppointDateMd(5),
CommonUtils.getAppointDateMd(5), CommonUtils.getCalendarWeek(CommonUtils.getAppointDate(5)),
CommonUtils.getCalendarWeek(CommonUtils.getAppointDate(5)), CommonUtils.getAppointDate(5)
CommonUtils.getAppointDate(5) )
) )
) add(
add( ScheduleEntity(
ScheduleEntity( CommonUtils.getAppointDateMd(6),
CommonUtils.getAppointDateMd(6), CommonUtils.getCalendarWeek(CommonUtils.getAppointDate(6)),
CommonUtils.getCalendarWeek(CommonUtils.getAppointDate(6)), CommonUtils.getAppointDate(6)
CommonUtils.getAppointDate(6) )
) )
)
}) })
} 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 -> setOnItemClickListener { adapter, view, position ->
adapter.data.forEach { adapter.data.forEach {
it as ScheduleEntity it as ScheduleEntity
...@@ -143,6 +200,7 @@ class MatchContentFragment : RefreshVP2Fragment<MatchContentPresenter>(), ...@@ -143,6 +200,7 @@ class MatchContentFragment : RefreshVP2Fragment<MatchContentPresenter>(),
val item = adapter.getItem(position) as ScheduleEntity val item = adapter.getItem(position) as ScheduleEntity
item.isSelected = true item.isSelected = true
adapter.notifyItemRangeChanged(0,adapter.itemCount) adapter.notifyItemRangeChanged(0,adapter.itemCount)
mPage = 1
presenter?.getMatchList(sportId,sportType,item.wholeTime,mPage,PAGE_COUNT) 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