Messaging: Fix warnings about drawables and colors

* They need the theme provided now
* Follow the suggestion by AS
  (sometimes we use ResourcesCompat, sometimes not)

Change-Id: Ie3023fee13a6fc04bd4b912721ba19dcc08befba
This commit is contained in:
Michael W
2024-12-26 14:55:13 +01:00
parent fd63d5f125
commit d430161ca0
17 changed files with 116 additions and 71 deletions
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2015 The Android Open Source Project
* Copyright (C) 2024 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -170,7 +171,8 @@ public class WidgetConversationListService extends RemoteViewsService {
builder.setSpan(new StyleSpan(Typeface.ITALIC), 0, text.length(),
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
builder.setSpan(new ForegroundColorSpan(
resources.getColor(R.color.widget_text_color)),
resources.getColor(R.color.widget_text_color,
mContext.getTheme())),
0, text.length(),
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
remoteViews.setTextViewText(R.id.errorText, builder);
@@ -389,7 +389,8 @@ public class WidgetConversationService extends RemoteViewsService {
final Spannable colorStr = new SpannableString(statusText);
if (showInRed) {
colorStr.setSpan(new ForegroundColorSpan(
mContext.getResources().getColor(R.color.timestamp_text_failed)),
mContext.getResources().getColor(R.color.timestamp_text_failed,
mContext.getTheme())),
0, statusText.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
}
remoteViews.setTextViewText(R.id.date, colorStr);