From 093a00c572a29d292bc6bbb09559611cb61e1331 Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Thu, 30 Dec 2021 00:26:05 +0100 Subject: 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 --- res/layout/emoji_pane.xml | 2 +- res/layout/keyboard.xml | 2 +- res/values/arrays.xml | 9 +++++++++ res/values/strings.xml | 4 ++++ res/values/themes.xml | 13 +++++++++++++ res/xml/settings.xml | 2 +- 6 files changed, 29 insertions(+), 3 deletions(-) (limited to 'res') diff --git a/res/layout/emoji_pane.xml b/res/layout/emoji_pane.xml index 3c58330..2931282 100644 --- a/res/layout/emoji_pane.xml +++ b/res/layout/emoji_pane.xml @@ -1,5 +1,5 @@ - + diff --git a/res/layout/keyboard.xml b/res/layout/keyboard.xml index b15f6d0..8af048d 100644 --- a/res/layout/keyboard.xml +++ b/res/layout/keyboard.xml @@ -1,2 +1,2 @@ - + 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 @@ 3 4 + + @string/pref_theme_e_dark + @string/pref_theme_e_light + + dark + + dark + light + 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 @@ %sdp Label size Size of characters displayed on the keyboard (%.2fx) + Theme + %s + Dark + Light 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 @@ ?attr/emoji_button_bg ?attr/colorLabel + diff --git a/res/xml/settings.xml b/res/xml/settings.xml index 568b6c1..8561717 100644 --- a/res/xml/settings.xml +++ b/res/xml/settings.xml @@ -2,7 +2,6 @@ - /> @@ -16,6 +15,7 @@ + -- cgit v1.2.3