CompactCalendarView icon indicating copy to clipboard operation
CompactCalendarView copied to clipboard

Add event

Open Arunkrishna008 opened this issue 8 years ago • 2 comments

@SundeepK ,this is awesome library

i just added your dependency.i cant add a new event ,

add event method got deprecated.

how to change event add based on date.now the add method is based on time stamp.

Arunkrishna008 avatar Dec 01 '17 10:12 Arunkrishna008

You can use 2 other ways:

    /**
     *  Adds an event to be drawn as an indicator in the calendar.
     *  If adding multiple events see {@link #addEvents(List)}} method.
     * @param event to be added to the calendar
     * @param shouldInvalidate true if the view should invalidate
     */
    public void addEvent(Event event, boolean shouldInvalidate);

    /**
     * Adds multiple events to the calendar and invalidates the view once all events are added.
     */
    public void addEvents(List<Event> events);

It was a mistake that I made early on allowing people to control if they wanted to re-draw the the calendar. addEvent(Event event, boolean shouldInvalidate); allows you to add events without causing the calendar to redraw saving on performance by passing in false in the second parmeter. But it probably wasn't too useful.

So you can simply call calendarview.addEvent(someEventt, true);. Adding multiple events is best done through addEvents(List<Event> events); method.

SundeepK avatar Dec 16 '17 18:12 SundeepK

Say I have Firestore.. Collection = "2018-11-7", Document (randomKey) with fields Xvalue (TimeInMillis) and dataField ) .

How to add this with addEvents ?

stephyswe avatar Nov 06 '18 23:11 stephyswe