2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-28 12:47:43 +00:00

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.
This commit is contained in:
Arun Parolikkal 2022-10-31 16:41:39 -04:00 committed by Simon Redman
parent aacd0fa32a
commit 31d1882c6a
2 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="primary">@android:color/system_accent2_300</color>
<color name="primaryDark">@android:color/system_neutral1_900</color>
<color name="accent">@android:color/system_accent2_300</color>
<color name="disabled_grey">#EEEEEE</color>
<color name="on_secondary">@android:color/system_accent1_700</color>
<color name="on_high_contrast">@android:color/system_neutral1_50</color>
<color name="text_color_primary">@android:color/system_neutral2_0</color>
<color name="text_color">@android:color/system_neutral2_50</color>
<color name="toolbar_color">@android:color/system_neutral1_900</color>
<color name="card_stroke_color">@android:color/system_neutral2_800</color>
<color name="activity_background">@android:color/system_neutral1_900</color>
<item name="lightMode" type="bool">false</item>
<!-- This is for dark theme. In dark theme both selected and unselected text in the
navigation bar should be white. This is different from the light theme as both states have
different colors so light theme has a selector for this value-->
<color name="state_list_drawer_text">@android:color/white</color>
</resources>

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="primary">@android:color/system_accent2_500</color>
<color name="primaryDark">@android:color/system_neutral1_50</color>
<color name="accent">@android:color/system_accent2_500</color>
<color name="disabled_grey">#EEEEEE</color>
<color name="on_secondary">@android:color/system_accent1_200</color>
<color name="on_high_contrast">@android:color/system_accent1_700</color>
<color name="text_color_primary">@android:color/system_accent2_700</color>
<color name="text_color">@android:color/system_neutral2_700</color>
<color name="toolbar_color">@android:color/system_neutral1_50</color>
<color name="card_stroke_color">@android:color/system_neutral2_100</color>
<color name="activity_background">@android:color/system_neutral1_50</color>
<item name="lightMode" type="bool">true</item>
</resources>