EventsCalendar
EventsCalendar copied to clipboard
Different event colors possible?
I'm looking for a way to display different event points in different colors.
For example: 06/28/2022 -> Green dot 06/29/2022 -> Red dot
I wish I could show a different color for each service, like in this example:
for (service in services!!)
{
val parser = SimpleDateFormat("dd.MM.yyyy hh:mm")
val dayFormatter = SimpleDateFormat("d")
val monthFormatter = SimpleDateFormat("M")
val yearFormatter = SimpleDateFormat("yyyy")
val day = dayFormatter.format(parser.parse(service.from)).toInt()
val month = monthFormatter.format(parser.parse(service.from)).toInt() - 1
val year = yearFormatter.format(parser.parse(service.from)).toInt()
val color = Color.parseColor("#" + service.shift!!.shiftColor)
val c = Calendar.getInstance()
c.set(Calendar.MONTH, month)
c.set(Calendar.DAY_OF_MONTH, day)
c.set(Calendar.YEAR, year)
calendarView.setEventDotColor(color = color)
calendarView.addEvent(c)
}
However, I have only found out that the event color can be set for the entire calendar.