AgendaCalendarView
AgendaCalendarView copied to clipboard
How to add more events to current dynamically?
agendaCalendarView.init(data, minDate, maxDate, Locale.getDefault(), this);
I want to add more data to the widget after init it. Could anybody please help?
+1
https://github.com/thermatk/AgendaCalendarView/tree/0569ea7acd8345cb9946ff2af64fb5983d9b6b09
@ArchitSandesara What can I see there?
@theZoker It is the sample app of adding events dynamically.
https://github.com/thermatk/AgendaCalendarView/tree/0569ea7acd8345cb9946ff2af64fb5983d9b6b09
I downloaded the sample, but the events are being added once, and only on ".init()". Am I missing something? Where is the dynamic part?
Try "init()" again with updated eventList
I am actually using "init()" again, the problem is that this solution resets the calendar, returning it to today. The behavior I was expecting was to load each day only when requested. After digging through the source code I realised that this isn't possible the way the component is currently structured.
You can add more events after the agendaCalendarView.init() by calling CalendarManager.loadEvents(). The side effect is it will forget about any initial events that were added during gendaCalendarView.init() . You will be responsible for keeping a list of ALL the events for the calendar and calling CalendarManager.loadEvents() when events are added/deleted from the list. Another side effect for doing this is it will scroll back to the current date after loading, so if today is Oct 16 and you've scrolled to say Mar 1 and you call CalendarManager.loadEvents() it will automatically scroll back to Oct 16. That's been my experience so far with this control.