From 91aeeee2bcde463ca50b97b43d5fbb673e23c25e Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 24 Aug 2017 12:13:41 +0200 Subject: [PATCH] add colored dots to the widget list too --- .../calendar/adapters/EventListWidgetAdapter.kt | 2 ++ .../calendar/adapters/EventListWidgetAdapterOld.kt | 4 ++++ app/src/main/res/layout/event_list_item_widget.xml | 13 +++++++++++++ 3 files changed, 19 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/adapters/EventListWidgetAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/adapters/EventListWidgetAdapter.kt index 572302dd8..85360556e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/adapters/EventListWidgetAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/adapters/EventListWidgetAdapter.kt @@ -16,6 +16,7 @@ import com.simplemobiletools.calendar.helpers.Formatter import com.simplemobiletools.calendar.models.ListEvent import com.simplemobiletools.calendar.models.ListItem import com.simplemobiletools.calendar.models.ListSection +import com.simplemobiletools.commons.extensions.getColoredIcon import org.joda.time.DateTime import java.util.* @@ -39,6 +40,7 @@ class EventListWidgetAdapter(val context: Context, val intent: Intent) : RemoteV setTextViewText(R.id.event_item_title, item.title) setTextViewText(R.id.event_item_description, item.description) setTextViewText(R.id.event_item_start, if (item.isAllDay) allDayString else Formatter.getTimeFromTS(context, item.startTS)) + setImageViewBitmap(R.id.event_item_color, context.resources.getColoredIcon(textColor, R.drawable.monthly_event_dot)) if (item.startTS == item.endTS) { setViewVisibility(R.id.event_item_end, View.INVISIBLE) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/adapters/EventListWidgetAdapterOld.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/adapters/EventListWidgetAdapterOld.kt index 0ffd59e45..531c09b7a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/adapters/EventListWidgetAdapterOld.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/adapters/EventListWidgetAdapterOld.kt @@ -1,11 +1,13 @@ package com.simplemobiletools.calendar.adapters import android.content.Context +import android.graphics.PorterDuff import android.graphics.drawable.Drawable import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.widget.BaseAdapter +import android.widget.ImageView import android.widget.TextView import com.simplemobiletools.calendar.R import com.simplemobiletools.calendar.helpers.Formatter @@ -67,6 +69,7 @@ class EventListWidgetAdapterOld(val context: Context, val mEvents: List + +