File tree Expand file tree Collapse file tree 9 files changed +31
-12
lines changed
java/com/orgzly/android/widgets Expand file tree Collapse file tree 9 files changed +31
-12
lines changed Original file line number Diff line number Diff line change @@ -94,8 +94,7 @@ object WidgetColors {
9494 )
9595 )
9696
97- // TODO:
98- val colorDayNight = mapOf (
97+ val dataDependentColors = mapOf (
9998 " dynamic-day" to mapOf (
10099 " todo" to R .color.widget_light_state_todo_color,
101100 " done" to R .color.widget_light_state_done_color,
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ object WidgetStyle {
4141
4242 @ColorInt
4343 private fun getColor (context : Context , scheme : String , name : String ): Int {
44- val s = WidgetColors .colorDayNight [scheme]?.get(name).let { value ->
44+ val s = WidgetColors .dataDependentColors [scheme]?.get(name).let { value ->
4545 if (BuildConfig .LOG_DEBUG ) LogUtils .d(TAG , " $scheme /$name : $value " )
4646 value ? : throw Exception (" Not defined: $scheme /$name " )
4747 }
Original file line number Diff line number Diff line change 44 xmlns : android =" http://schemas.android.com/apk/res/android"
55 xmlns : tools =" http://schemas.android.com/tools"
66 android : id =" @+id/item_list_widget_layout"
7- android : theme =" @style/Theme.Material3.DynamicColors.DayNight "
7+ android : theme =" @style/ListWidgetTheme "
88 android : layout_width =" match_parent"
99 android : layout_height =" wrap_content"
1010 android : orientation =" horizontal"
Original file line number Diff line number Diff line change 44 xmlns : android =" http://schemas.android.com/apk/res/android"
55 xmlns : tools =" http://schemas.android.com/tools"
66 android : id =" @+id/widget_list_item_divider_value"
7- android : theme =" @style/Theme.Material3.DynamicColors.DayNight "
7+ android : theme =" @style/ListWidgetTheme "
88 android : layout_width =" match_parent"
99 android : layout_height =" wrap_content"
1010 android : layout_gravity =" center_vertical"
Original file line number Diff line number Diff line change 22
33<LinearLayout
44 xmlns : android =" http://schemas.android.com/apk/res/android"
5- android : theme =" @style/Theme.Material3.DynamicColors.DayNight "
5+ android : theme =" @style/ListWidgetTheme "
66 android : layout_width =" match_parent"
77 android : layout_height =" match_parent"
88 android : orientation =" vertical" >
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" utf-8" ?>
2+
3+ <resources xmlns : tools =" http://schemas.android.com/tools" >
4+ <string-array name =" widget_color_scheme" tools : ignore =" InconsistentArrays" >
5+ <item >@string/color_scheme_dynamic</item >
6+ <item >@string/color_scheme_light</item >
7+ <item >@string/color_scheme_dark</item >
8+ <item >@string/color_scheme_black</item >
9+ </string-array >
10+ <string-array name =" widget_color_scheme_values" tools : ignore =" InconsistentArrays" >
11+ <item >dynamic</item >
12+ <item >light</item >
13+ <item >dark</item >
14+ <item >black</item >
15+ </string-array >
16+ </resources >
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" utf-8" ?>
2+
3+ <resources >
4+ <style name =" ListWidgetTheme" parent =" Theme.Material3.DynamicColors.DayNight" />
5+ </resources >
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" utf-8" ?>
22
3- <resources >
3+ <resources xmlns : tools = " http://schemas.android.com/tools " >
44 <!-- Overwrite system Locale -->
55 <string name =" pref_key_ignore_system_locale" translatable =" false" >pref_key_ignore_system_locale</string >
66 <bool name =" pref_default_ignore_system_locale" translatable =" false" >false</bool >
510510
511511 <string name =" pref_key_widget_color_scheme" translatable =" false" >pref_key_widget_color_scheme</string >
512512 <string name =" pref_default_widget_color_scheme" translatable =" false" >light</string >
513- <string-array name =" widget_color_scheme" >
514- <item >@string/color_scheme_dynamic</item >
513+ <string-array name =" widget_color_scheme" tools : ignore =" InconsistentArrays" >
515514 <item >@string/color_scheme_light</item >
516515 <item >@string/color_scheme_dark</item >
517516 <item >@string/color_scheme_black</item >
518517 </string-array >
519- <string-array name =" widget_color_scheme_values" >
520- <item >dynamic</item >
518+ <string-array name =" widget_color_scheme_values" tools : ignore =" InconsistentArrays" >
521519 <item >light</item >
522520 <item >dark</item >
523521 <item >black</item >
Original file line number Diff line number Diff line change 144144 <item name =" colorTertiaryContainer" >@color/grey_800</item >
145145 <item name =" colorOnTertiaryContainer" >@color/grey_400</item >
146146 <item name =" colorError" >@color/red_200</item >
147-
148147 </style >
149148
150149 <!-- Color scheme -->
225224 <!-- <item name="android:textAppearanceMedium">@style/TextAppearance.AppCompat.Large</item>-->
226225 </style >
227226
227+ <style name =" ListWidgetTheme" parent =" Theme.Material3.DynamicColors.DayNight" />
228+
228229 <style name =" OverFlow" parent =" Widget.AppCompat.ActionButton.Overflow" >
229230 <item name =" tint" >?android:textColorPrimary</item >
230231 </style >
You can’t perform that action at this time.
0 commit comments