Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ import android.util.Log
import android.view.View
import android.widget.RemoteViews
import android.widget.RemoteViewsService.RemoteViewsFactory
import androidx.core.content.ContextCompat
import androidx.core.net.toUri
import com.nextcloud.android.common.ui.util.PlatformThemeUtil
import it.niedermann.owncloud.notes.R
import it.niedermann.owncloud.notes.edit.EditNoteActivity
import it.niedermann.owncloud.notes.persistence.NotesRepository
Expand Down Expand Up @@ -148,6 +150,14 @@ class NoteListWidgetFactory internal constructor(private val context: Context, i
} else {
setViewVisibility(R.id.widget_entry_category, View.VISIBLE)
setTextViewText(R.id.widget_entry_category, note.category)

val textColorId = if (PlatformThemeUtil.isDarkMode(context)) {
R.color.text_color
} else {
R.color.category_border
}
val textColor = ContextCompat.getColor(context, textColorId)
setTextColor(R.id.widget_entry_category, textColor)
}

val starIconId = if (note.favorite) {
Expand Down
15 changes: 15 additions & 0 deletions app/src/main/res/drawable/category_widget_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!--
~ Nextcloud Notes - Android Client
~
~ SPDX-FileCopyrightText: 2017-2026 Nextcloud GmbH and Nextcloud contributors
~ SPDX-FileCopyrightText: 2017-2026 Alper Ozturk <alper.ozturk@nextcloud.com>
~ SPDX-License-Identifier: GPL-3.0-or-later
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/category_widget_background" />
<stroke
android:width="1dip"
android:color="@color/category_border" />
<corners android:radius="8dp" />
</shape>
3 changes: 1 addition & 2 deletions app/src/main/res/layout/widget_entry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@
android:layout_gravity="center_vertical"
android:paddingHorizontal="8dp"
android:paddingVertical="4dp"
android:background="@drawable/border"
android:background="@drawable/category_widget_background"
android:textSize="12sp"
android:textColor="@color/category_border"
android:gravity="center"
android:visibility="gone"
tools:visibility="visible"
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/res/values-night/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,7 @@
<color name="action_mode_background">#1E1E1E</color>
<color name="fontAppbar">@android:color/white</color>
<color name="primary_button_text_color">#000000</color>

<color name="category_widget_background">@color/material_dynamic_secondary20</color>
<color name="category_border">@color/transparent</color>
</resources>
2 changes: 2 additions & 0 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,6 @@
<color name="online">#2D7B41</color>
<color name="busy">#DB0606</color>
<color name="offline">@color/high_emphasis_text</color>

<color name="category_widget_background">@color/transparent</color>
</resources>
Loading