Open FlorianStock opened 2 years ago
Hi,
How can we update the list of adapter ?
val calendarView : AgendaCalendarView = view.findViewById(R.id.agenda_calendar_view) adapter = AgendaAdapter(this.requireContext()) contentManager = CalendarContentManager(this, calendarView, adapter) contentManager.setDateRange(minDate, maxDate) contentManager.locale = Locale.FRENCH
viewModel.interventionsListOfUser.observe(viewLifecycleOwner) { intervention -> eventList.clear() intervention.forEach { inter -> val dayStart = Calendar.getInstance() dayStart.time = Date(inter.startAt!!) val dayEnd = Calendar.getInstance() dayEnd.time = Date(inter.finishAt!!) val dayItem = DayItem.buildDayItemFromCal(dayStart) eventList.add(AgendaEvent(dayStart, dayEnd, dayItem, inter)) } }
Ok, i think my problem is resolved : https://github.com/ognev-zair/Kotlin-AgendaCalendarView/pulls I have duplcation of my values when i rotated the screen. Please accept the pull request. Thanks
Hi,
How can we update the list of adapter ?
val calendarView : AgendaCalendarView = view.findViewById(R.id.agenda_calendar_view) adapter = AgendaAdapter(this.requireContext()) contentManager = CalendarContentManager(this, calendarView, adapter) contentManager.setDateRange(minDate, maxDate) contentManager.locale = Locale.FRENCH