diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/adapters/EventListWidgetAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/adapters/EventListWidgetAdapter.kt index 6e4c03422..5fa664c49 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/adapters/EventListWidgetAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/adapters/EventListWidgetAdapter.kt @@ -2,6 +2,7 @@ package com.simplemobiletools.calendar.pro.adapters import android.content.Context import android.content.Intent +import android.graphics.Paint import android.widget.RemoteViews import android.widget.RemoteViewsService import com.simplemobiletools.calendar.pro.R @@ -29,6 +30,8 @@ class EventListWidgetAdapter(val context: Context, val intent: Intent) : RemoteV private var replaceDescription = context.config.replaceDescription private var dimPastEvents = context.config.dimPastEvents private var mediumFontSize = context.getWidgetFontSize() + private var smallMargin = context.resources.getDimension(R.dimen.small_margin).toInt() + private var normalMargin = context.resources.getDimension(R.dimen.normal_margin).toInt() init { initConfigValues() @@ -107,6 +110,21 @@ class EventListWidgetAdapter(val context: Context, val intent: Intent) : RemoteV setTextSize(R.id.event_item_title, mediumFontSize) setTextSize(R.id.event_item_time, mediumFontSize) + setVisibleIf(R.id.event_item_task_image, item.isTask) + applyColorFilter(R.id.event_item_task_image, curTextColor) + + if (item.isTask) { + setViewPadding(R.id.event_item_title, 0, 0, smallMargin, 0) + } else { + setViewPadding(R.id.event_item_title, normalMargin, 0, smallMargin, 0) + } + + if (item.isTaskCompleted) { + setInt(R.id.event_item_title, "setPaintFlags", Paint.ANTI_ALIAS_FLAG or Paint.STRIKE_THRU_TEXT_FLAG) + } else { + setInt(R.id.event_item_title, "setPaintFlags", Paint.ANTI_ALIAS_FLAG) + } + Intent().apply { putExtra(EVENT_ID, item.id) putExtra(EVENT_OCCURRENCE_TS, item.startTS) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/MyWidgetMonthlyProvider.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/MyWidgetMonthlyProvider.kt index 7a017c069..e6f641e06 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/MyWidgetMonthlyProvider.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/MyWidgetMonthlyProvider.kt @@ -151,6 +151,7 @@ class MyWidgetMonthlyProvider : AppWidgetProvider() { setTextSize(R.id.day_monthly_event_id, smallerFontSize - 3f) setBackgroundColor(R.id.day_monthly_event_holder, backgroundColor) setVisibleIf(R.id.day_monthly_task_image, it.isTask()) + applyColorFilter(R.id.day_monthly_task_image, eventTextColor) if (it.isTaskCompleted()) { setInt(R.id.day_monthly_event_id, "setPaintFlags", Paint.ANTI_ALIAS_FLAG or Paint.STRIKE_THRU_TEXT_FLAG) diff --git a/app/src/main/res/layout/event_list_item_widget.xml b/app/src/main/res/layout/event_list_item_widget.xml index 56e0537ba..ad4aba515 100644 --- a/app/src/main/res/layout/event_list_item_widget.xml +++ b/app/src/main/res/layout/event_list_item_widget.xml @@ -20,11 +20,21 @@ android:paddingTop="@dimen/tiny_margin" android:scaleType="fitXY" /> + +