alamkanak / Android-Week-View

Android Week View is an android library to display calendars (week view or day view) within the app. It supports custom styling.
Apache License 2.0
3.42k stars 1.23k forks source link

How to delete an event #396

Closed preyesm closed 7 years ago

preyesm commented 7 years ago

Is there a way to delete the events added to the weekView.

Saw how to do it in one of the closed issues.Thanks

QArtur99 commented 7 years ago

@preyesm buddy how to do it ? i have the same problem I'm using fragments and i can just delete events which i added while ago but if sth was before i cant remove it immediately

QArtur99 commented 7 years ago

I got it Thanks

TroniPM commented 7 years ago

@QArtur99 can you please tell me how you did this? Thanks.

QArtur99 commented 7 years ago

When youre loading your weekView you have to create list for all events then onMonthChange you just selecting events for 1 month so when you want remove event you need remove it from your list and than call onMonthChange for this 1 month where you changed sth in order to select again items for this month

TroniPM commented 7 years ago

Well, i was removing the weekevent from this list and than calling "getWeekView().notifyDatasetChanged();", but i couln't make the weekview redraw the calendar without this event... This is awkward.

QArtur99 commented 7 years ago

I'm doing sth like that

private List<WeekViewEvent> events; events.remove(event); onMonthChange(2017, 1);`

mWeekView.notifyDatasetChanged();