Skip to content

Different event dot colors possible? #40

@cr0wfir3

Description

@cr0wfir3

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions