simplify primary color getting at the EventsHelper

This commit is contained in:
tibbi 2019-02-22 23:18:08 +01:00
parent d4179f1a66
commit c402a68100
1 changed files with 2 additions and 1 deletions

View File

@ -253,9 +253,10 @@ class EventsHelper(val context: Context) {
eventTypeColors.put(it.id!!, it.color)
}
val primaryColor = context.resources.getColor(R.color.color_primary)
events.forEach {
it.updateIsPastEvent()
it.color = eventTypeColors.get(it.eventType) ?: context.resources.getColor(R.color.color_primary)
it.color = eventTypeColors.get(it.eventType) ?: primaryColor
}
callback(events)