Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different event dot colors possible? #40

Open
cr0wfir3 opened this issue Jun 29, 2022 · 0 comments
Open

Different event dot colors possible? #40

cr0wfir3 opened this issue Jun 29, 2022 · 0 comments

Comments

@cr0wfir3
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant