i wat show current date with different color when i selected other date
i have same question ...how to show current date
@abhiwaikar, @yatindeokar
MaterialCalendarView calendarView = (MaterialCalendarView) findViewById(R.id.calendarView);
Calendar calendar = Calendar.getInstance();
calendarView.setDateSelected(calendar.getTime(), true);
You can actually do that using a decorator: https://github.com/prolificinteractive/material-calendarview/blob/master/docs/DECORATORS.md.
public class EventDecorator implements DayViewDecorator {
private final int color;
private final CalendarDay today;
public EventDecorator(int color, CalendarDay today) {
this.color = color;
this.today = today;
}
@Override
public boolean shouldDecorate(CalendarDay day) {
return day.equalsTo(today);
}
@Override
public void decorate(DayViewFacade view) {
view.addSpan(new DotSpan(5, color));
}
}
Once you are able to show today's date highlighted, you might need to improve using https://github.com/prolificinteractive/material-calendarview/blob/master/docs/CUSTOM_SELECTORS.md
@Override
public boolean shouldDecorate(CalendarDay day) {
return day.equalsTo(today); // change equalsTo to **equals**
}
Most helpful comment
@abhiwaikar, @yatindeokar