Search in sources :

Example 1 with OnDateSelectedListener

use of com.prolificinteractive.materialcalendarview.OnDateSelectedListener in project GeekNews by codeestX.

the class CalendarActivity method initEventAndData.

@Override
protected void initEventAndData() {
    setToolBar(mToolbar, "选择日期");
    mCalender.state().edit().setFirstDayOfWeek(Calendar.WEDNESDAY).setMinimumDate(CalendarDay.from(2013, 5, 20)).setMaximumDate(CalendarDay.from(DateUtil.getCurrentYear(), DateUtil.getCurrentMonth(), DateUtil.getCurrentDay())).setCalendarDisplayMode(CalendarMode.MONTHS).commit();
    mCalender.setOnDateChangedListener(new OnDateSelectedListener() {

        @Override
        public void onDateSelected(@NonNull MaterialCalendarView widget, @NonNull CalendarDay date, boolean selected) {
            mDate = date;
        }
    });
}
Also used : OnDateSelectedListener(com.prolificinteractive.materialcalendarview.OnDateSelectedListener) MaterialCalendarView(com.prolificinteractive.materialcalendarview.MaterialCalendarView) CalendarDay(com.prolificinteractive.materialcalendarview.CalendarDay)

Aggregations

CalendarDay (com.prolificinteractive.materialcalendarview.CalendarDay)1 MaterialCalendarView (com.prolificinteractive.materialcalendarview.MaterialCalendarView)1 OnDateSelectedListener (com.prolificinteractive.materialcalendarview.OnDateSelectedListener)1