Skip to content

Commit a41164d

Browse files
committed
fix(widget): content colors
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
1 parent 464dcf8 commit a41164d

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

app/src/main/java/it/niedermann/owncloud/notes/widget/notelist/NoteListWidgetFactory.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import android.widget.RemoteViews
1616
import android.widget.RemoteViewsService.RemoteViewsFactory
1717
import androidx.core.content.ContextCompat
1818
import androidx.core.net.toUri
19-
import com.nextcloud.android.common.ui.theme.utils.ColorRole
2019
import com.nextcloud.android.common.ui.util.PlatformThemeUtil
2120
import it.niedermann.owncloud.notes.R
2221
import it.niedermann.owncloud.notes.edit.EditNoteActivity
@@ -152,11 +151,13 @@ class NoteListWidgetFactory internal constructor(private val context: Context, i
152151
setViewVisibility(R.id.widget_entry_category, View.VISIBLE)
153152
setTextViewText(R.id.widget_entry_category, note.category)
154153

155-
if (PlatformThemeUtil.isDarkMode(context)) {
156-
setTextColor(R.id.widget_entry_category,ContextCompat.getColor(context, R.color.text_color))
154+
val textColorId = if (PlatformThemeUtil.isDarkMode(context)) {
155+
R.color.text_color
157156
} else {
158-
setTextColor(R.id.widget_entry_category,ContextCompat.getColor(context, R.color.category_border))
157+
R.color.category_border
159158
}
159+
val textColor = ContextCompat.getColor(context, textColorId)
160+
setTextColor(R.id.widget_entry_category, textColor)
160161
}
161162

162163
val starIconId = if (note.favorite) {

app/src/main/res/drawable/note_category_text_view_background.xml renamed to app/src/main/res/drawable/category_widget_background.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88
<shape xmlns:android="http://schemas.android.com/apk/res/android"
99
android:shape="rectangle">
10-
<solid android:color="@color/note_category_background" />
10+
<solid android:color="@color/category_widget_background" />
1111
<stroke
1212
android:width="1dip"
1313
android:color="@color/category_border" />

app/src/main/res/layout/widget_entry.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
android:layout_gravity="center_vertical"
4646
android:paddingHorizontal="8dp"
4747
android:paddingVertical="4dp"
48-
android:background="@drawable/note_category_text_view_background"
48+
android:background="@drawable/category_widget_background"
4949
android:textSize="12sp"
5050
android:gravity="center"
5151
android:visibility="gone"

app/src/main/res/values-night/colors.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@
4343
<color name="fontAppbar">@android:color/white</color>
4444
<color name="primary_button_text_color">#000000</color>
4545

46-
<color name="note_category_background">@color/material_dynamic_secondary20</color>
46+
<color name="category_widget_background">@color/material_dynamic_secondary20</color>
4747
<color name="category_border">@color/transparent</color>
4848
</resources>

app/src/main/res/values/colors.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,5 @@
5858
<color name="busy">#DB0606</color>
5959
<color name="offline">@color/high_emphasis_text</color>
6060

61-
<color name="note_category_background">@color/transparent</color>
61+
<color name="category_widget_background">@color/transparent</color>
6262
</resources>

0 commit comments

Comments
 (0)