From 31d1882c6a3499dfd36a13d3c4e66a90d1243c6d Mon Sep 17 00:00:00 2001 From: Arun Parolikkal Date: Mon, 31 Oct 2022 16:41:39 -0400 Subject: [PATCH] Basic support for A12 colors Colors don't work in some cards, menus and the hamburger menu ## Summary I'm trying to make KDEConnect pull colours from the Material 3.0 wallpaper in Android 12. I've managed to do this to an extent by editing the xml files in res/values*. There are, however, certain UI elements that do not respond to the changes I've made, with no obvious files where their colours may be changed. ## Screenshots ### The devices screen looks great (Except "KDE Connect Devices" in the App bar isn't themed.) ![Screenshot_20211215-175156_KDE_Connect](/uploads/f00a03a9857a696acbf3ba14a0d01e23/Screenshot_20211215-175156_KDE_Connect.png) ### The hamburger menu has a white color in light mode. Don't know where this is set and how to change it ![Screenshot_20211215-175206_KDE_Connect](/uploads/349b2bf72596a388e445f7462672b358/Screenshot_20211215-175206_KDE_Connect.png) ### Three dot menu has a white colour ![Screenshot_20211215-175210_KDE_Connect](/uploads/4a3204de26233ac3f6ea612358e9387d/Screenshot_20211215-175210_KDE_Connect.png) ### Add new devices looks good too ![Screenshot_20211215-175221_KDE_Connect](/uploads/78db4cd796ba31bfb763b9e2fae6e216/Screenshot_20211215-175221_KDE_Connect.png) ### Not the popup menus though ![Screenshot_20211215-175225_KDE_Connect](/uploads/a0fb8dbf4c0cc1fd3a2774d5ff8fda00/Screenshot_20211215-175225_KDE_Connect.png) ### Cards in the About section are still white ![Screenshot_20211215-175235_KDE_Connect](/uploads/18d1b3337af45eb7c9bcb157a0b34357/Screenshot_20211215-175235_KDE_Connect.png) ### Dark mode works fine ![Screenshot_20211215-175255_KDE_Connect](/uploads/3c2777e3f97ab7f377c6ace8b83297f2/Screenshot_20211215-175255_KDE_Connect.png) ### But again, some UI elements like the hamburger menu aren't themed. ![Screenshot_20211215-175302_KDE_Connect](/uploads/2ea118e6a352bcf4d5dc8760495d7b12/Screenshot_20211215-175302_KDE_Connect.png) I'll keep trying to figure out how to make these elements to their proper colours, but I've done a lot of searching through the source and couldn't figure out how. I'm absolutely new to Android development. Help please. ## Test Plan For the changes made thus far, none are needed. --- res/values-night-v31/colors.xml | 21 +++++++++++++++++++++ res/values-notnight-v31/colors.xml | 16 ++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 res/values-night-v31/colors.xml create mode 100644 res/values-notnight-v31/colors.xml diff --git a/res/values-night-v31/colors.xml b/res/values-night-v31/colors.xml new file mode 100644 index 00000000..a0f1deb5 --- /dev/null +++ b/res/values-night-v31/colors.xml @@ -0,0 +1,21 @@ + + + @android:color/system_accent2_300 + @android:color/system_neutral1_900 + @android:color/system_accent2_300 + #EEEEEE + @android:color/system_accent1_700 + @android:color/system_neutral1_50 + @android:color/system_neutral2_0 + @android:color/system_neutral2_50 + @android:color/system_neutral1_900 + @android:color/system_neutral2_800 + @android:color/system_neutral1_900 + false + + + @android:color/white + + diff --git a/res/values-notnight-v31/colors.xml b/res/values-notnight-v31/colors.xml new file mode 100644 index 00000000..f04fb6b8 --- /dev/null +++ b/res/values-notnight-v31/colors.xml @@ -0,0 +1,16 @@ + + + @android:color/system_accent2_500 + @android:color/system_neutral1_50 + @android:color/system_accent2_500 + #EEEEEE + @android:color/system_accent1_200 + @android:color/system_accent1_700 + @android:color/system_accent2_700 + @android:color/system_neutral2_700 + @android:color/system_neutral1_50 + @android:color/system_neutral2_100 + @android:color/system_neutral1_50 + true + +