mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-01-29 18:09:25 +01:00
simplify primary color getting at the EventsHelper
This commit is contained in:
parent
d4179f1a66
commit
c402a68100
@ -253,9 +253,10 @@ class EventsHelper(val context: Context) {
|
|||||||
eventTypeColors.put(it.id!!, it.color)
|
eventTypeColors.put(it.id!!, it.color)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val primaryColor = context.resources.getColor(R.color.color_primary)
|
||||||
events.forEach {
|
events.forEach {
|
||||||
it.updateIsPastEvent()
|
it.updateIsPastEvent()
|
||||||
it.color = eventTypeColors.get(it.eventType) ?: context.resources.getColor(R.color.color_primary)
|
it.color = eventTypeColors.get(it.eventType) ?: primaryColor
|
||||||
}
|
}
|
||||||
|
|
||||||
callback(events)
|
callback(events)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user