EventsCalendar icon indicating copy to clipboard operation
EventsCalendar copied to clipboard

Different event colors possible?

Open cr0wfir3 opened this issue 2 years ago • 0 comments

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.

cr0wfir3 avatar Jun 29 '22 12:06 cr0wfir3