AgendaCalendarView
AgendaCalendarView copied to clipboard
Mark events in month view
Is it possible to mark dates in the month view (above the day list)?
I want to mark, when a event is available on this day.
You can mark it when traverse the event list, and update ui in WeeksAdapter.bindWeek.
public void setEvents(List<CalendarEvent> eventList){ List<CalendarEvent> locatedEvent = new ArrayList<CalendarEvent>(); for (WeekItem weekItem : getWeeks()) { for (DayItem dayItem : weekItem.getDayItems()) { boolean isEventForDay = false; if(eventList != null){ locatedEvent.clear(); for (CalendarEvent event : eventList) { if (DateHelper.isBetweenInclusive(dayItem.getDate(), event.getStartTime(), event.getEndTime())) { CalendarEvent copy = event.copy(); Calendar dayInstance = Calendar.getInstance(); dayInstance.setTime(dayItem.getDate()); copy.setInstanceDay(dayInstance); copy.setDayReference(dayItem); copy.setWeekReference(weekItem); // add instances in chronological order getEvents().add(copy); isEventForDay = true; locatedEvent.add(event); } } eventList.removeAll(locatedEvent); } if (isEventForDay) { //record the agenda info on calendar item. dayItem.setHasAgenda(true); } } } }