From 218723865da275dcbbeb38c7fe67730650a0b294 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 25 Oct 2018 21:44:33 +0200 Subject: [PATCH] update widget text color when appropriate --- .../com/simplemobiletools/notes/adapters/WidgetAdapter.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/notes/adapters/WidgetAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/notes/adapters/WidgetAdapter.kt index 9ebac50d..5a273dd4 100644 --- a/app/src/main/kotlin/com/simplemobiletools/notes/adapters/WidgetAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/notes/adapters/WidgetAdapter.kt @@ -19,7 +19,7 @@ import com.simplemobiletools.notes.helpers.OPEN_NOTE_ID class WidgetAdapter(val context: Context, val intent: Intent) : RemoteViewsService.RemoteViewsFactory { private val textIds = arrayOf(R.id.widget_text_left, R.id.widget_text_center, R.id.widget_text_right) - private val widgetTextColor = context.config.widgetTextColor + private var widgetTextColor = context.config.widgetTextColor override fun getViewAt(position: Int): RemoteViews { val noteId = intent.getIntExtra(NOTE_ID, 1) @@ -58,7 +58,9 @@ class WidgetAdapter(val context: Context, val intent: Intent) : RemoteViewsServi override fun getItemId(position: Int) = position.toLong() - override fun onDataSetChanged() {} + override fun onDataSetChanged() { + widgetTextColor = context.config.widgetTextColor + } override fun hasStableIds() = true