diff options
| author | Jules Aguillon | 2021-12-30 00:26:05 +0100 |
|---|---|---|
| committer | Jules Aguillon | 2021-12-30 00:26:05 +0100 |
| commit | 093a00c572a29d292bc6bbb09559611cb61e1331 (patch) | |
| tree | 945f43f7c4bbff2bf5d22fa3a12c7d42833dc97d /res | |
| parent | 40b1ec63a932606fb432ee81801acf147e9ee70e (diff) | |
| download | unexpected-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')
| -rw-r--r-- | res/layout/emoji_pane.xml | 2 | ||||
| -rw-r--r-- | res/layout/keyboard.xml | 2 | ||||
| -rw-r--r-- | res/values/arrays.xml | 9 | ||||
| -rw-r--r-- | res/values/strings.xml | 4 | ||||
| -rw-r--r-- | res/values/themes.xml | 13 | ||||
| -rw-r--r-- | res/xml/settings.xml | 2 |
6 files changed, 29 insertions, 3 deletions
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 @@ <?xml version="1.0" encoding="utf-8"?> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:hardwareAccelerated="false" android:theme="@style/Dark"> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:hardwareAccelerated="false"> <juloo.keyboard2.EmojiGroupButtonsBar android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"/> <juloo.keyboard2.EmojiGridView android:id="@+id/emoji_grid" android:background="?attr/colorKeyboard" android:layout_width="fill_parent" android:layout_height="@dimen/emoji_grid_height"/> <LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"> 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 @@ <?xml version="1.0" encoding="utf-8"?> -<juloo.keyboard2.Keyboard2View xmlns:android="http://schemas.android.com/apk/res/android" android:hardwareAccelerated="false" android:theme="@style/Dark" android:background="?attr/colorKeyboard"/> +<juloo.keyboard2.Keyboard2View xmlns:android="http://schemas.android.com/apk/res/android" android:hardwareAccelerated="false" android:background="?attr/colorKeyboard"/> 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> 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 @@ <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> <PreferenceCategory android:title="@string/pref_category_layout"> <ListPreference android:key="layout" android:title="@string/pref_layout_title" android:summary="@string/pref_layout_summary" android:defaultValue="system" android:entries="@array/pref_layout_entries" android:entryValues="@array/pref_layout_values"/> - /> <ListPreference android:key="accents" android:title="@string/pref_accents_title" android:summary="@string/pref_accents_summary" android:defaultValue="@string/pref_accents_default" android:entries="@array/pref_accents_entries" android:entryValues="@array/pref_accents_values"/> </PreferenceCategory> <PreferenceCategory android:title="@string/pref_category_typing"> @@ -16,6 +15,7 @@ <juloo.common.IntSlideBarPreference android:key="vibrate_duration" android:title="@string/pref_vibrate_duration_title" android:summary="@string/pref_vibrate_duration_summary" android:defaultValue="20" min="5" max="50"/> </PreferenceCategory> <PreferenceCategory android:title="@string/pref_category_style"> + <ListPreference android:key="theme" android:title="@string/pref_theme" android:summary="@string/pref_theme_summary" android:defaultValue="@string/pref_theme_default" android:entries="@array/pref_theme_entries" android:entryValues="@array/pref_theme_values"/> <juloo.common.IntSlideBarPreference android:key="margin_bottom" android:title="@string/pref_margin_bottom_title" android:summary="@string/pref_margin_bottom_summary" android:defaultValue="5" min="0" max="100"/> <juloo.common.IntSlideBarPreference android:key="key_height" android:title="@string/pref_key_height_title" android:summary="@string/pref_key_height_summary" android:defaultValue="50" min="30" max="90"/> <juloo.common.IntSlideBarPreference android:key="horizontal_margin" android:title="@string/pref_horizontal_margin_title" android:summary="@string/pref_horizontal_margin_summary" android:defaultValue="3" min="0" max="20"/> |
