AgendaCalendarView icon indicating copy to clipboard operation
AgendaCalendarView copied to clipboard

Mark events in month view

Open TheZoker opened this issue 8 years ago • 2 comments

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.

TheZoker avatar Jul 11 '16 13:07 TheZoker

You can mark it when traverse the event list, and update ui in WeeksAdapter.bindWeek.

Xiaoning1943 avatar Jul 29 '16 08:07 Xiaoning1943

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); } } } }

Xiaoning1943 avatar Jul 29 '16 08:07 Xiaoning1943