You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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)
}
However, I have only found out that the event color can be set for the entire calendar.
The text was updated successfully, but these errors were encountered: