add the old dark theme

This commit is contained in:
dslul 2020-09-30 19:09:08 +02:00
parent be180ccada
commit 6532ed54df
9 changed files with 197 additions and 21 deletions

View file

@ -39,9 +39,10 @@ public final class KeyboardTheme implements Comparable<KeyboardTheme> {
public static final int THEME_ID_ICS = 0; public static final int THEME_ID_ICS = 0;
public static final int THEME_ID_KLP = 2; public static final int THEME_ID_KLP = 2;
public static final int THEME_ID_LXX_LIGHT = 3; public static final int THEME_ID_LXX_LIGHT = 3;
public static final int THEME_ID_LXX_DARK = 4; public static final int THEME_ID_LXX_DARK_AMOLED = 4;
public static final int THEME_ID_LIGHT_BORDER = 5; public static final int THEME_ID_LIGHT_BORDER = 5;
public static final int THEME_ID_DARK_BORDER = 6; public static final int THEME_ID_DARK_BORDER = 6;
public static final int THEME_ID_LXX_DARK = 7;
public static final int DEFAULT_THEME_ID = THEME_ID_DARK_BORDER; public static final int DEFAULT_THEME_ID = THEME_ID_DARK_BORDER;
private static KeyboardTheme[] AVAILABLE_KEYBOARD_THEMES; private static KeyboardTheme[] AVAILABLE_KEYBOARD_THEMES;
@ -60,6 +61,9 @@ public final class KeyboardTheme implements Comparable<KeyboardTheme> {
new KeyboardTheme(THEME_ID_LXX_DARK, "LXXDark", R.style.KeyboardTheme_LXX_Dark, new KeyboardTheme(THEME_ID_LXX_DARK, "LXXDark", R.style.KeyboardTheme_LXX_Dark,
// This has never been selected as default theme. // This has never been selected as default theme.
VERSION_CODES.BASE), VERSION_CODES.BASE),
new KeyboardTheme(THEME_ID_LXX_DARK_AMOLED, "LXXDarkAmoled", R.style.KeyboardTheme_LXX_Dark_Amoled,
// This has never been selected as default theme.
VERSION_CODES.BASE),
new KeyboardTheme(THEME_ID_LIGHT_BORDER, "LXXLightBorder", R.style.KeyboardTheme_LXX_Light_Border, new KeyboardTheme(THEME_ID_LIGHT_BORDER, "LXXLightBorder", R.style.KeyboardTheme_LXX_Light_Border,
// This has never been selected as default theme. // This has never been selected as default theme.
Build.VERSION_CODES.BASE), Build.VERSION_CODES.BASE),

View file

@ -1,12 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 The Android Open Source Project <!-- Copyright (C) 2014 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
You may obtain a copy of the License at You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -23,13 +20,13 @@
<!-- Toggle keys. Use checkable/checked state. --> <!-- Toggle keys. Use checkable/checked state. -->
<item android:state_checkable="true" android:state_checked="true" android:state_pressed="true" <item android:state_checkable="true" android:state_checked="true" android:state_pressed="true"
android:drawable="@color/key_background_lxx_dark" /> android:drawable="@drawable/btn_keyboard_key_pressed_on_lxx_dark" />
<item android:state_checkable="true" android:state_pressed="true" <item android:state_checkable="true" android:state_pressed="true"
android:drawable="@color/key_background_lxx_dark" /> android:drawable="@drawable/btn_keyboard_key_pressed_off_lxx_dark" />
<item android:state_checkable="true" android:state_checked="true" <item android:state_checkable="true" android:state_checked="true"
android:drawable="@color/key_background_lxx_dark" /> android:drawable="@drawable/btn_keyboard_key_normal_on_lxx_dark" />
<item android:state_checkable="true" <item android:state_checkable="true"
android:drawable="@color/key_background_lxx_dark" /> android:drawable="@drawable/btn_keyboard_key_normal_off_lxx_dark" />
<!-- Empty background keys. --> <!-- Empty background keys. -->
<item android:state_empty="true" android:state_pressed="true" <item android:state_empty="true" android:state_pressed="true"

View file

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Action keys. -->
<item android:state_active="true" android:state_pressed="true"
android:drawable="@drawable/btn_keyboard_key_active_pressed_lxx_dark" />
<item android:state_active="true"
android:drawable="@drawable/btn_keyboard_key_active_lxx_dark" />
<!-- Toggle keys. Use checkable/checked state. -->
<item android:state_checkable="true" android:state_checked="true" android:state_pressed="true"
android:drawable="@color/key_background_amoled" />
<item android:state_checkable="true" android:state_pressed="true"
android:drawable="@color/key_background_amoled" />
<item android:state_checkable="true" android:state_checked="true"
android:drawable="@color/key_background_amoled" />
<item android:state_checkable="true"
android:drawable="@color/key_background_amoled" />
<!-- Empty background keys. -->
<item android:state_empty="true" android:state_pressed="true"
android:drawable="@color/key_background_amoled" />
<item android:state_empty="true"
android:drawable="@android:color/transparent" />
<!-- Normal keys. -->
<item android:state_pressed="true"
android:drawable="@color/key_background_amoled" />
<item android:drawable="@color/key_background_amoled" />
</selector>

View file

@ -237,7 +237,8 @@
<enum name="ICS" value="0" /> <enum name="ICS" value="0" />
<enum name="KLP" value="2" /> <enum name="KLP" value="2" />
<enum name="LXXLight" value="3" /> <enum name="LXXLight" value="3" />
<enum name="LXXDark" value="4" /> <enum name="LXXDarkAmoled" value="4" />
<enum name="LXXDark" value="7" />
<enum name="LXXLightBorder" value="5" /> <enum name="LXXLightBorder" value="5" />
<enum name="LXXDarkBorder" value="6" /> <enum name="LXXDarkBorder" value="6" />
</attr> </attr>

View file

@ -71,8 +71,9 @@
<color name="suggested_word_color_lxx_dark">#B3FFFFFF</color> <color name="suggested_word_color_lxx_dark">#B3FFFFFF</color>
<color name="gesture_trail_color_lxx_dark">#80CBC4</color> <color name="gesture_trail_color_lxx_dark">#80CBC4</color>
<color name="sliding_key_input_preview_color_lxx_dark">#B380CBC4</color> <color name="sliding_key_input_preview_color_lxx_dark">#B380CBC4</color>
<color name="key_background_lxx_dark">#000</color> <color name="key_background_lxx_dark">#263238</color>
<color name="key_background_pressed_lxx_dark">#000</color> <color name="key_background_pressed_lxx_dark">#19FFFFFF</color>
<color name="key_background_amoled">#000000</color>
<color name="suggested_word_background_selected_lxx_dark">#19FFFFFF</color> <color name="suggested_word_background_selected_lxx_dark">#19FFFFFF</color>
<color name="gesture_floating_preview_color_lxx_dark">#E621272B</color> <color name="gesture_floating_preview_color_lxx_dark">#E621272B</color>
<color name="emoji_tab_page_indicator_background_lxx_dark">#21272B</color> <color name="emoji_tab_page_indicator_background_lxx_dark">#21272B</color>

View file

@ -24,6 +24,7 @@
<item>@string/keyboard_theme_dark_border</item> <item>@string/keyboard_theme_dark_border</item>
<item>@string/keyboard_theme_material_light</item> <item>@string/keyboard_theme_material_light</item>
<item>@string/keyboard_theme_material_dark</item> <item>@string/keyboard_theme_material_dark</item>
<item>@string/keyboard_theme_material_dark_amoled</item>
<item>@string/keyboard_theme_holo_white</item> <item>@string/keyboard_theme_holo_white</item>
<item>@string/keyboard_theme_holo_blue</item> <item>@string/keyboard_theme_holo_blue</item>
</string-array> </string-array>
@ -33,6 +34,7 @@
<item>5</item> <item>5</item>
<item>6</item> <item>6</item>
<item>3</item> <item>3</item>
<item>7</item>
<item>4</item> <item>4</item>
<item>2</item> <item>2</item>
<item>0</item> <item>0</item>

View file

@ -355,7 +355,9 @@ mobile devices. [CHAR LIMIT=25] -->
<!-- The keyboard theme name, Holo Blue. This is marked as translatable="false" because this is a proper name of system-wide UI Theme. --> <!-- The keyboard theme name, Holo Blue. This is marked as translatable="false" because this is a proper name of system-wide UI Theme. -->
<string name="keyboard_theme_holo_blue" translatable="false">Holo Blue</string> <string name="keyboard_theme_holo_blue" translatable="false">Holo Blue</string>
<!-- The keyboard theme name, Material Dark. This is marked as translatable="false" because this is a proper name of system-wide UI Theme. --> <!-- The keyboard theme name, Material Dark. This is marked as translatable="false" because this is a proper name of system-wide UI Theme. -->
<string name="keyboard_theme_material_dark" translatable="false">Material Dark (AMOLED)</string> <string name="keyboard_theme_material_dark" translatable="false">Material Dark</string>
<!-- The keyboard theme name, Material Dark. This is marked as translatable="false" because this is a proper name of system-wide UI Theme. -->
<string name="keyboard_theme_material_dark_amoled" translatable="false">Material Dark (AMOLED)</string>
<!-- The keyboard theme name, Material Light. This is marked as translatable="false" because this is a proper name of system-wide UI Theme. --> <!-- The keyboard theme name, Material Light. This is marked as translatable="false" because this is a proper name of system-wide UI Theme. -->
<string name="keyboard_theme_material_light" translatable="false">Material Light</string> <string name="keyboard_theme_material_light" translatable="false">Material Light</string>
<string name="keyboard_theme_dark_border" translatable="false">Material Dark Border</string> <string name="keyboard_theme_dark_border" translatable="false">Material Dark Border</string>

View file

@ -0,0 +1,139 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="KeyboardTheme.LXX_Dark_Amoled" parent="KeyboardIcons.LXX_Dark">
<item name="inputViewStyle">@style/InputView.LXX</item>
<item name="keyboardStyle">@style/Keyboard.LXX_Dark_Amoled</item>
<item name="keyboardViewStyle">@style/KeyboardView.LXX_Dark_Amoled</item>
<item name="mainKeyboardViewStyle">@style/MainKeyboardView.LXX_Dark_Amoled</item>
<item name="emojiPalettesViewStyle">@style/EmojiPalettesView.LXX_Dark_Amoled</item>
<item name="moreKeysKeyboardStyle">@style/MoreKeysKeyboard.LXX_Dark_Amoled</item>
<item name="moreKeysKeyboardViewStyle">@style/MoreKeysKeyboardView.LXX_Dark_Amoled</item>
<item name="moreKeysKeyboardViewForActionStyle">@style/MoreKeysKeyboardView.LXX_Dark_Amoled.Action</item>
<item name="suggestionStripViewStyle">@style/SuggestionStripView.LXX_Dark_Amoled</item>
<item name="suggestionWordStyle">@style/SuggestionWord.LXX_Dark_Amoled</item>
</style>
<style
name="Keyboard.LXX_Dark_Amoled"
parent="Keyboard"
>
<!-- This should be aligned with KeyboardTheme.THEME_ID_* -->
<item name="themeId">LXXDarkAmoled</item>
</style>
<style
name="KeyboardView.LXX_Dark_Amoled"
parent="KeyboardView.LXX"
>
<item name="android:background">#000</item>
<item name="keyBackground">@drawable/btn_keyboard_key_lxx_dark_amoled</item>
<item name="functionalKeyBackground">@color/key_background_amoled</item>
<item name="spacebarBackground">@color/key_background_amoled</item>
<item name="keyTextColor">@color/key_text_color_lxx_dark</item>
<item name="keyTextInactivatedColor">@color/key_functional_text_color_lxx_dark</item>
<item name="functionalTextColor">@color/key_text_color_lxx_dark</item>
<item name="keyHintLetterColor">@color/key_hint_letter_color_lxx_dark</item>
<item name="keyHintLabelColor">@color/key_text_inactive_color_lxx_dark</item>
<item name="keyShiftedLetterHintInactivatedColor">@color/key_text_inactive_color_lxx_dark</item>
<item name="keyShiftedLetterHintActivatedColor">@color/key_text_color_lxx_dark</item>
<item name="keyPreviewTextColor">@color/key_text_color_lxx_dark</item>
</style>
<style
name="MainKeyboardView.LXX_Dark_Amoled"
parent="KeyboardView.LXX_Dark_Amoled"
>
<item name="moreKeysKeyboardForActionLayout">@layout/more_keys_keyboard_for_action_lxx</item>
<item name="keyPreviewBackground">@drawable/keyboard_key_feedback_lxx_dark</item>
<item name="keyPreviewHeight">@dimen/config_key_preview_height_lxx</item>
<item name="keyPreviewOffset">@dimen/config_key_preview_offset_lxx</item>
<item name="keyPreviewShowUpAnimator">@anim/key_preview_show_up_lxx</item>
<item name="keyPreviewDismissAnimator">@anim/key_preview_dismiss_lxx</item>
<item name="gestureFloatingPreviewTextColor">@color/auto_correct_color_lxx_dark</item>
<item name="gestureFloatingPreviewColor">@color/gesture_floating_preview_color_lxx_dark</item>
<item name="gestureTrailColor">@color/gesture_trail_color_lxx_dark</item>
<item name="slidingKeyInputPreviewColor">@color/sliding_key_input_preview_color_lxx_dark</item>
<item name="languageOnSpacebarTextColor">@color/key_text_inactive_color_lxx_dark</item>
<!-- A negative value to disable text shadow layer. -->
<item name="languageOnSpacebarTextShadowRadius">-1.0</item>
</style>
<!-- Though {@link org.dslul.openboard.inputmethod.keyboard.emoji.EmojiPalettesView} doesn't extend
{@link org.dslul.openboard.inputmethod.keyboard.KeyboardView}, some views inside it, for instance
delete button, need themed {@link org.dslul.openboard.inputmethod.keyboard.KeyboardView}
attributes. -->
<style
name="EmojiPalettesView.LXX_Dark_Amoled"
parent="MainKeyboardView.LXX_Dark_Amoled"
>
<item name="categoryIndicatorEnabled">false</item>
<item name="categoryPageIndicatorColor">@color/highlight_color_lxx_dark</item>
<item name="categoryPageIndicatorBackground">@color/emoji_tab_page_indicator_background_lxx_dark</item>
<item name="iconEmojiRecentsTab">@drawable/ic_emoji_recents_lxx_dark</item>
<item name="iconEmojiCategory1Tab">@drawable/ic_emoji_people_lxx_dark</item>
<item name="iconEmojiCategory2Tab">@drawable/ic_emoji_objects_lxx_dark</item>
<item name="iconEmojiCategory3Tab">@drawable/ic_emoji_nature_lxx_dark</item>
<item name="iconEmojiCategory4Tab">@drawable/ic_emoji_places_lxx_dark</item>
<item name="iconEmojiCategory5Tab">@drawable/ic_emoji_symbols_lxx_dark</item>
<item name="iconEmojiCategory6Tab">@drawable/ic_emoji_emoticons_lxx_dark</item>
<item name="iconEmojiCategory7Tab">@drawable/ic_emoji_flag_lxx_dark</item>
<item name="iconEmojiCategory8Tab">@drawable/ic_emoji_people_lxx_dark</item>
<item name="iconEmojiCategory9Tab">@drawable/ic_emoji_nature_lxx_dark</item>
<item name="iconEmojiCategory10Tab">@drawable/ic_emoji_food_lxx_dark</item>
<item name="iconEmojiCategory11Tab">@drawable/ic_emoji_places_lxx_dark</item>
<item name="iconEmojiCategory12Tab">@drawable/ic_emoji_activity_lxx_dark</item>
<item name="iconEmojiCategory13Tab">@drawable/ic_emoji_objects_lxx_dark</item>
<item name="iconEmojiCategory14Tab">@drawable/ic_emoji_symbols_lxx_dark</item>
<item name="iconEmojiCategory15Tab">@drawable/ic_emoji_flag_lxx_dark</item>
<item name="iconEmojiCategory16Tab">@drawable/ic_emoji_people_lxx_dark</item>
</style>
<style
name="MoreKeysKeyboard.LXX_Dark_Amoled"
parent="Keyboard.LXX_Dark_Amoled"
>
<item name="keyboardTopPadding">0%p</item>
<item name="keyboardBottomPadding">0%p</item>
<item name="horizontalGap">0%p</item>
<item name="touchPositionCorrectionData">@null</item>
</style>
<style
name="MoreKeysKeyboardView.LXX_Dark_Amoled"
parent="KeyboardView.LXX_Dark_Amoled"
>
<item name="android:background">#000</item>
<item name="keyBackground">@drawable/btn_keyboard_key_popup_lxx_dark</item>
<item name="divider">@drawable/more_keys_divider</item>
<item name="keyTypeface">normal</item>
<item name="verticalCorrection">@dimen/config_more_keys_keyboard_vertical_correction_holo</item>
</style>
<style
name="MoreKeysKeyboardView.LXX_Dark_Amoled.Action"
parent="MoreKeysKeyboardView.LXX_Dark_Amoled"
>
<item name="android:background">@android:color/transparent</item>
<item name="keyBackground">@drawable/btn_keyboard_key_popup_action_lxx_dark</item>
<item name="divider">@null</item>
<item name="keyLabelFlags">keepBackgroundAspectRatio</item>
</style>
<style
name="SuggestionStripView.LXX_Dark_Amoled"
parent="KeyboardView.LXX_Dark_Amoled"
>
<item name="suggestionsCountInStrip">@integer/config_suggestions_count_in_strip</item>
<item name="centerSuggestionPercentile">@fraction/config_center_suggestion_percentile</item>
<item name="maxMoreSuggestionsRow">@integer/config_max_more_suggestions_row</item>
<item name="minMoreSuggestionsWidth">@fraction/config_min_more_suggestions_width</item>
<item name="android:background">#000</item>
<item name="android:src">@drawable/suggestions_strip_divider_lxx_dark</item>
<item name="suggestionStripOptions">autoCorrectBold|validTypedWordBold</item>
<item name="colorValidTypedWord">@color/typed_word_color_lxx_dark</item>
<item name="colorTypedWord">@color/typed_word_color_lxx_dark</item>
<item name="colorAutoCorrect">@color/auto_correct_color_lxx_dark</item>
<item name="colorSuggested">@color/suggested_word_color_lxx_dark</item>
<item name="alphaObsoleted">70%</item>
</style>
<style
name="SuggestionWord.LXX_Dark_Amoled"
parent="SuggestionWord"
>
<item name="android:background">@drawable/btn_suggestion_lxx_dark</item>
<item name="android:textColor">@color/highlight_color_lxx_dark</item>
</style>
</resources>

View file

@ -42,7 +42,7 @@
name="KeyboardView.LXX_Dark" name="KeyboardView.LXX_Dark"
parent="KeyboardView.LXX" parent="KeyboardView.LXX"
> >
<item name="android:background">#000</item> <item name="android:background">@drawable/keyboard_background_lxx_dark</item>
<item name="keyBackground">@drawable/btn_keyboard_key_lxx_dark</item> <item name="keyBackground">@drawable/btn_keyboard_key_lxx_dark</item>
<item name="functionalKeyBackground">@drawable/btn_keyboard_key_functional_lxx_dark</item> <item name="functionalKeyBackground">@drawable/btn_keyboard_key_functional_lxx_dark</item>
<item name="spacebarBackground">@drawable/btn_keyboard_spacebar_lxx_dark</item> <item name="spacebarBackground">@drawable/btn_keyboard_spacebar_lxx_dark</item>
@ -115,7 +115,7 @@
name="MoreKeysKeyboardView.LXX_Dark" name="MoreKeysKeyboardView.LXX_Dark"
parent="KeyboardView.LXX_Dark" parent="KeyboardView.LXX_Dark"
> >
<item name="android:background">#000</item> <item name="android:background">@drawable/keyboard_popup_panel_background_lxx_dark</item>
<item name="keyBackground">@drawable/btn_keyboard_key_popup_lxx_dark</item> <item name="keyBackground">@drawable/btn_keyboard_key_popup_lxx_dark</item>
<item name="divider">@drawable/more_keys_divider</item> <item name="divider">@drawable/more_keys_divider</item>
<item name="keyTypeface">normal</item> <item name="keyTypeface">normal</item>
@ -138,7 +138,7 @@
<item name="centerSuggestionPercentile">@fraction/config_center_suggestion_percentile</item> <item name="centerSuggestionPercentile">@fraction/config_center_suggestion_percentile</item>
<item name="maxMoreSuggestionsRow">@integer/config_max_more_suggestions_row</item> <item name="maxMoreSuggestionsRow">@integer/config_max_more_suggestions_row</item>
<item name="minMoreSuggestionsWidth">@fraction/config_min_more_suggestions_width</item> <item name="minMoreSuggestionsWidth">@fraction/config_min_more_suggestions_width</item>
<item name="android:background">#000</item> <item name="android:background">@drawable/keyboard_suggest_strip_lxx_dark</item>
<item name="android:src">@drawable/suggestions_strip_divider_lxx_dark</item> <item name="android:src">@drawable/suggestions_strip_divider_lxx_dark</item>
<item name="suggestionStripOptions">autoCorrectBold|validTypedWordBold</item> <item name="suggestionStripOptions">autoCorrectBold|validTypedWordBold</item>
<item name="colorValidTypedWord">@color/typed_word_color_lxx_dark</item> <item name="colorValidTypedWord">@color/typed_word_color_lxx_dark</item>