-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathawidget_patch.diff
More file actions
21 lines (20 loc) · 1.57 KB
/
awidget_patch.diff
File metadata and controls
21 lines (20 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
--- app/src/main/java/com/leanbitlab/lwidget/AwidgetProvider.kt
+++ app/src/main/java/com/leanbitlab/lwidget/AwidgetProvider.kt
@@ -377,10 +377,12 @@
val primaryColor = resolveColor(textColorPrimaryIdx, true, useLightTheme)
val secondaryColor = resolveColor(textColorSecondaryIdx, false, useLightTheme)
+ val dateColorIdx = prefs.getInt("date_color_idx", 0)
+
// Slightly distinct colors for date and next alarm
val dateColor = if (useDynamicColors && android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.S) {
// Warm accent for date
context.getColor(if (useLightTheme) android.R.color.system_accent2_700 else android.R.color.system_accent2_100)
} else {
- if (useLightTheme) android.graphics.Color.parseColor("#AA555544") else android.graphics.Color.parseColor("#BBDDDDCC")
+ when (dateColorIdx) {
+ 2 -> android.graphics.Color.rgb(prefs.getInt("date_color_r", 255), prefs.getInt("date_color_g", 255), prefs.getInt("date_color_b", 255))
+ 1 -> if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.S) context.getColor(android.R.color.system_accent2_500) else android.graphics.Color.YELLOW
+ else -> if (useLightTheme) android.graphics.Color.parseColor("#AA555544") else android.graphics.Color.parseColor("#BBDDDDCC")
+ }
}
val alarmColor = if (useDynamicColors && android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.S) {