我有一个来自该库[https://github.com/prolificinteractive/material-calendarview]的calendarView,下面有一个recyclerView来显示该月的事件,当我更改月份时,我希望列表更改为相应的月份
我正在这样设置当前月份的当前列表
LocalDate date = LocalDate.now();
LocalDate ftD = date.with(TemporalAdjusters.firstDayOfMonth());
String firstD = ftD.toString();
String firstDate = firstD + " 00:00:00";
LocalDate edD = date.with(TemporalAdjusters.lastDayOfMonth());
String endD = edD.toString();
String endDate = endD + " 23:00:00";
List<Events> listado = SQLite.select().from(Events.class)
.where(Events_Table.end_date.greaterThanOrEq(firstDate))
.and(Events_Table.init_date.lessThanOrEq(endDate))
.queryList();
mExampleAdapter = new ExampleAdapter(listado);
mRecyclerView.setAdapter(mExampleAdapter);
这就是我要给听众的东西,基本上没什么
widget.setOnMonthChangedListener(new OnMonthChangedListener() {
@Override
public void onMonthChanged(MaterialCalendarView materialCalendarView, CalendarDay){
}
});