如何为CalendarView创建侦听器以动态更改下面的事件列表

时间:2019-07-13 15:18:52

标签: java android calendar listener

我有一个来自该库[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){
     }
});

0 个答案:

没有答案