abouttreesummaryrefslogcommitdiff
path: root/res/values
diff options
context:
space:
mode:
authorJules Aguillon2021-12-30 00:26:05 +0100
committerJules Aguillon2021-12-30 00:26:05 +0100
commit093a00c572a29d292bc6bbb09559611cb61e1331 (patch)
tree945f43f7c4bbff2bf5d22fa3a12c7d42833dc97d /res/values
parent40b1ec63a932606fb432ee81801acf147e9ee70e (diff)
downloadunexpected-keyboard-093a00c572a29d292bc6bbb09559611cb61e1331.tar.gz
unexpected-keyboard-093a00c572a29d292bc6bbb09559611cb61e1331.zip
Add themes
Add a "Theme" option to choose between a dark and light theme. The light theme uses the colors of the dark theme with the luminance inversed. The reloading after a configuration change is changed slightly: - Special handling is needed when the Theme is changed (recreate the views) - The default implementation of 'onConfigurationChanged' is used Which triggers more refresh (but don't recreate the views) - 'onCreateInputView' is no longer needed
Diffstat (limited to 'res/values')
-rw-r--r--res/values/arrays.xml9
-rw-r--r--res/values/strings.xml4
-rw-r--r--res/values/themes.xml13
3 files changed, 26 insertions, 0 deletions
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
index 77be329..819b1e6 100644
--- a/res/values/arrays.xml
+++ b/res/values/arrays.xml
@@ -18,4 +18,13 @@
<item>3</item>
<item>4</item>
</string-array>
+ <string-array name="pref_theme_entries">
+ <item>@string/pref_theme_e_dark</item>
+ <item>@string/pref_theme_e_light</item>
+ </string-array>
+ <string name="pref_theme_default">dark</string>
+ <string-array name="pref_theme_values">
+ <item>dark</item>
+ <item>light</item>
+ </string-array>
</resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index ce753cf..6ca5e6d 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -40,4 +40,8 @@
<string name="pref_horizontal_margin_summary">%sdp</string>
<string name="pref_character_size_title">Label size</string>
<string name="pref_character_size_summary">Size of characters displayed on the keyboard (%.2fx)</string>
+ <string name="pref_theme">Theme</string>
+ <string name="pref_theme_summary">%s</string>
+ <string name="pref_theme_e_dark">Dark</string>
+ <string name="pref_theme_e_light">Light</string>
</resources>
diff --git a/res/values/themes.xml b/res/values/themes.xml
index 02f97be..11689d5 100644
--- a/res/values/themes.xml
+++ b/res/values/themes.xml
@@ -32,4 +32,17 @@
<item name="emoji_key_bg" type="color">?attr/emoji_button_bg</item>
<item name="emoji_key_text" type="color">?attr/colorLabel</item>
</style>
+ <style name="Light">
+ <item name="colorKeyboard">#e3e3e3</item>
+ <item name="colorKey">#cfcfcf</item>
+ <item name="colorKeyActivated">#e3e3e3</item>
+ <item name="colorLabel">#000000</item>
+ <item name="colorLabelActivated">#64afdd</item>
+ <item name="colorLabelLocked">#64dd76</item>
+ <item name="colorSubLabel">#5e5e5e</item>
+ <item name="emoji_button_bg" type="color">#dedede</item>
+ <item name="emoji_color" type="color">#000000</item>
+ <item name="emoji_key_bg" type="color">?attr/emoji_button_bg</item>
+ <item name="emoji_key_text" type="color">?attr/colorLabel</item>
+ </style>
</resources>