From adaaf9ffb8f8ee0fa568d232ac140b74b0be4e38 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" <takaoka@google.com> Date: Tue, 27 Aug 2013 13:01:20 +0900 Subject: [PATCH] Rename theme file names Bug: 10415342 Change-Id: I692b157953f77c610482b494cbaeed4430bcb629 --- java/res/drawable/btn_keyboard_key.xml | 37 ----------- ...ingerbread.xml => btn_keyboard_key_gb.xml} | 0 ...opup.xml => btn_keyboard_key_popup_gb.xml} | 0 ...n_suggestion.xml => btn_suggestion_gb.xml} | 0 ...dback.xml => keyboard_key_feedback_gb.xml} | 0 .../{key_preview.xml => key_preview_gb.xml} | 2 +- .../touch-position-correction.xml | 4 +- java/res/values/colors.xml | 2 +- ...-icons-white.xml => keyboard-icons-gb.xml} | 0 java/res/values/keyboard-icons-ics.xml | 2 +- java/res/values/styles.xml | 66 +++++++++---------- .../{themes-gingerbread.xml => themes-gb.xml} | 12 ++-- java/res/values/themes-ics.xml | 20 +++--- java/res/values/touch-position-correction.xml | 4 +- .../keyboard/KeyboardSwitcher.java | 4 +- 15 files changed, 56 insertions(+), 97 deletions(-) delete mode 100644 java/res/drawable/btn_keyboard_key.xml rename java/res/drawable/{btn_keyboard_key_gingerbread.xml => btn_keyboard_key_gb.xml} (100%) rename java/res/drawable/{btn_keyboard_key_popup.xml => btn_keyboard_key_popup_gb.xml} (100%) rename java/res/drawable/{btn_suggestion.xml => btn_suggestion_gb.xml} (100%) rename java/res/drawable/{keyboard_key_feedback.xml => keyboard_key_feedback_gb.xml} (100%) rename java/res/layout/{key_preview.xml => key_preview_gb.xml} (93%) rename java/res/values/{keyboard-icons-white.xml => keyboard-icons-gb.xml} (100%) rename java/res/values/{themes-gingerbread.xml => themes-gb.xml} (81%) diff --git a/java/res/drawable/btn_keyboard_key.xml b/java/res/drawable/btn_keyboard_key.xml deleted file mode 100644 index 112ac26366..0000000000 --- a/java/res/drawable/btn_keyboard_key.xml +++ /dev/null @@ -1,37 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2008 The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> - -<selector xmlns:android="http://schemas.android.com/apk/res/android"> - <!-- Toggle keys. Use checkable/checked state. --> - <item android:state_checkable="true" android:state_checked="true" - android:state_pressed="true" - android:drawable="@drawable/btn_keyboard_key_pressed_on" /> - <item android:state_checkable="true" android:state_pressed="true" - android:drawable="@drawable/btn_keyboard_key_pressed_off" /> - <item android:state_checkable="true" android:state_checked="true" - android:drawable="@drawable/btn_keyboard_key_normal_on" /> - <item android:state_checkable="true" - android:drawable="@drawable/btn_keyboard_key_normal_off" /> - - <!-- Empty background keys. --> - <item android:state_empty="true" - android:drawable="@drawable/transparent" /> - - <!-- Normal keys. --> - <item android:state_pressed="true" - android:drawable="@drawable/btn_keyboard_key_pressed" /> - <item android:drawable="@drawable/btn_keyboard_key_normal" /> -</selector> diff --git a/java/res/drawable/btn_keyboard_key_gingerbread.xml b/java/res/drawable/btn_keyboard_key_gb.xml similarity index 100% rename from java/res/drawable/btn_keyboard_key_gingerbread.xml rename to java/res/drawable/btn_keyboard_key_gb.xml diff --git a/java/res/drawable/btn_keyboard_key_popup.xml b/java/res/drawable/btn_keyboard_key_popup_gb.xml similarity index 100% rename from java/res/drawable/btn_keyboard_key_popup.xml rename to java/res/drawable/btn_keyboard_key_popup_gb.xml diff --git a/java/res/drawable/btn_suggestion.xml b/java/res/drawable/btn_suggestion_gb.xml similarity index 100% rename from java/res/drawable/btn_suggestion.xml rename to java/res/drawable/btn_suggestion_gb.xml diff --git a/java/res/drawable/keyboard_key_feedback.xml b/java/res/drawable/keyboard_key_feedback_gb.xml similarity index 100% rename from java/res/drawable/keyboard_key_feedback.xml rename to java/res/drawable/keyboard_key_feedback_gb.xml diff --git a/java/res/layout/key_preview.xml b/java/res/layout/key_preview_gb.xml similarity index 93% rename from java/res/layout/key_preview.xml rename to java/res/layout/key_preview_gb.xml index 2fcd0c4ddc..2f2a321a32 100644 --- a/java/res/layout/key_preview.xml +++ b/java/res/layout/key_preview_gb.xml @@ -21,7 +21,7 @@ <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:background="@drawable/keyboard_key_feedback" + android:background="@drawable/keyboard_key_feedback_gb" android:minWidth="32dp" android:gravity="center" /> diff --git a/java/res/values-sw600dp/touch-position-correction.xml b/java/res/values-sw600dp/touch-position-correction.xml index f77d3ae836..df07c1295b 100644 --- a/java/res/values-sw600dp/touch-position-correction.xml +++ b/java/res/values-sw600dp/touch-position-correction.xml @@ -37,7 +37,7 @@ </string-array> <string-array - name="touch_position_correction_data_gingerbread" + name="touch_position_correction_data_gb" translatable="false" > <!-- The default touch position data (See com.android.inputmethod.keyboard.ProximityInfo) @@ -48,7 +48,7 @@ </string-array> <string-array - name="touch_position_correction_data_ice_cream_sandwich" + name="touch_position_correction_data_ics" translatable="false" > <!-- The default touch position data (See com.android.inputmethod.keyboard.ProximityInfo) diff --git a/java/res/values/colors.xml b/java/res/values/colors.xml index 1f88d3cab9..6f00c91973 100644 --- a/java/res/values/colors.xml +++ b/java/res/values/colors.xml @@ -20,7 +20,7 @@ <color name="highlight_translucent_color_default">#99FCAE00</color> <color name="key_text_color_default">@android:color/white</color> <color name="key_text_shadow_color_default">#BB000000</color> - <color name="key_text_inactivated_color_default">@android:color/white</color> + <color name="key_text_inactivated_color_default">#66E0E4E5</color> <color name="key_hint_letter_color_default">#80000000</color> <color name="key_hint_label_color_default">#E0E0E4E5</color> <color name="key_shifted_letter_hint_inactivated_color_default">#66E0E4E5</color> diff --git a/java/res/values/keyboard-icons-white.xml b/java/res/values/keyboard-icons-gb.xml similarity index 100% rename from java/res/values/keyboard-icons-white.xml rename to java/res/values/keyboard-icons-gb.xml diff --git a/java/res/values/keyboard-icons-ics.xml b/java/res/values/keyboard-icons-ics.xml index 5ada27ae8e..9c9bc3cf7f 100644 --- a/java/res/values/keyboard-icons-ics.xml +++ b/java/res/values/keyboard-icons-ics.xml @@ -15,7 +15,7 @@ --> <resources> - <style name="KeyboardIcons.IceCreamSandwich"> + <style name="KeyboardIcons.ICS"> <!-- Keyboard icons --> <!-- TODO: The following holo icon for phone (drawable-hdpi and drawable-xhdpi) are missing. sym_keyboard_123_mic_holo diff --git a/java/res/values/styles.xml b/java/res/values/styles.xml index c73b28910b..97d3204112 100644 --- a/java/res/values/styles.xml +++ b/java/res/values/styles.xml @@ -15,11 +15,8 @@ --> <resources xmlns:android="http://schemas.android.com/apk/res/android"> - <!-- TODO: Remove "Basic" theme and make "IceCreamSandwich" default --> - <!-- Theme "Basic" --> + <!-- Default theme values --> <style name="Keyboard"> - <!-- This should be aligned with KeyboardSwitcher.KEYBOARD_THEMES[] --> - <item name="themeId">0</item> <item name="touchPositionCorrectionData">@array/touch_position_correction_data_default</item> <item name="rowHeight">25%p</item> <item name="moreKeysTemplate">@xml/kbd_more_keys_keyboard_template</item> @@ -33,7 +30,6 @@ </style> <style name="KeyboardView"> <item name="android:background">@drawable/keyboard_background</item> - <item name="keyBackground">@drawable/btn_keyboard_key</item> <item name="keyLetterSize">@fraction/key_letter_ratio</item> <item name="keyLargeLetterRatio">@fraction/key_large_letter_ratio</item> <item name="keyLabelSize">@fraction/key_label_ratio</item> @@ -43,7 +39,7 @@ <item name="keyShiftedLetterHintRatio">@fraction/key_uppercase_letter_ratio</item> <item name="keyTypeface">normal</item> <item name="keyTextColor">@color/key_text_color_default</item> - <item name="keyTextInactivatedColor">@color/key_text_color_default</item> + <item name="keyTextInactivatedColor">@color/key_text_inactivated_color_default</item> <item name="keyHintLetterColor">@color/key_hint_letter_color_default</item> <item name="keyHintLabelColor">@color/key_hint_label_color_default</item> <item name="keyShiftedLetterHintInactivatedColor">@color/key_shifted_letter_hint_inactivated_color_default</item> @@ -91,7 +87,6 @@ <item name="keyRepeatInterval">@integer/config_key_repeat_interval</item> <item name="longPressShiftLockTimeout">@integer/config_longpress_shift_lock_timeout</item> <item name="ignoreAltCodeKeyTimeout">@integer/config_ignore_alt_code_key_timeout</item> - <item name="keyPreviewLayout">@layout/key_preview</item> <item name="keyPreviewOffset">@dimen/key_preview_offset</item> <item name="keyPreviewHeight">@dimen/key_preview_height</item> <item name="keyPreviewLingerTimeout">@integer/config_key_preview_linger_timeout</item> @@ -140,7 +135,7 @@ name="MoreKeysKeyboardView" parent="KeyboardView" > - <item name="keyBackground">@drawable/btn_keyboard_key_popup</item> + <item name="keyBackground">@drawable/btn_keyboard_key_popup_gb</item> <item name="verticalCorrection">@dimen/more_keys_keyboard_vertical_correction</item> </style> <style name="MoreKeysKeyboardPanelStyle"> @@ -167,30 +162,31 @@ > </style> <style name="SuggestionBackgroundStyle"> - <item name="android:background">@drawable/btn_suggestion</item> + <item name="android:background">@drawable/btn_suggestion_gb</item> </style> <!-- Theme "Gingerbread" --> <style - name="Keyboard.Gingerbread" + name="Keyboard.GB" parent="Keyboard" > <!-- This should be aligned with KeyboardSwitcher.KEYBOARD_THEMES[] --> - <item name="themeId">8</item> - <item name="touchPositionCorrectionData">@array/touch_position_correction_data_gingerbread</item> + <item name="themeId">1</item> + <item name="touchPositionCorrectionData">@array/touch_position_correction_data_gb</item> <item name="horizontalGap">@fraction/key_horizontal_gap_gb</item> <item name="verticalGap">@fraction/key_bottom_gap_gb</item> </style> <style - name="KeyboardView.Gingerbread" + name="KeyboardView.GB" parent="KeyboardView" > <item name="android:background">@drawable/keyboard_dark_background</item> - <item name="keyBackground">@drawable/btn_keyboard_key_gingerbread</item> + <item name="keyBackground">@drawable/btn_keyboard_key_gb</item> <item name="keyTypeface">bold</item> + <item name="keyPreviewLayout">@layout/key_preview_gb</item> </style> <style - name="MainKeyboardView.Gingerbread" - parent="KeyboardView.Gingerbread" + name="MainKeyboardView.GB" + parent="KeyboardView.GB" > <item name="autoCorrectionSpacebarLedEnabled">true</item> <item name="autoCorrectionSpacebarLedIcon">@drawable/sym_keyboard_space_led</item> @@ -199,8 +195,8 @@ <item name="spacebarTextShadowColor">@color/spacebar_text_shadow_color_default</item> </style> <style - name="MoreKeysKeyboard.Gingerbread" - parent="Keyboard.Gingerbread" + name="MoreKeysKeyboard.GB" + parent="Keyboard.GB" > <item name="keyboardTopPadding">0%p</item> <item name="keyboardBottomPadding">0%p</item> @@ -208,26 +204,26 @@ <item name="touchPositionCorrectionData">@null</item> </style> <style - name="MoreKeysKeyboardView.Gingerbread" + name="MoreKeysKeyboardView.GB" parent="MoreKeysKeyboardView" > <item name="android:background">@null</item> </style> <!-- Theme "IceCreamSandwich" --> <style - name="Keyboard.IceCreamSandwich" + name="Keyboard.ICS" parent="Keyboard" > <!-- This should be aligned with KeyboardSwitcher.KEYBOARD_THEMES[] --> - <item name="themeId">5</item> + <item name="themeId">0</item> <item name="keyboardTopPadding">@fraction/keyboard_top_padding_ics</item> <item name="keyboardBottomPadding">@fraction/keyboard_bottom_padding_ics</item> <item name="horizontalGap">@fraction/key_horizontal_gap_ics</item> <item name="verticalGap">@fraction/key_bottom_gap_ics</item> - <item name="touchPositionCorrectionData">@array/touch_position_correction_data_ice_cream_sandwich</item> + <item name="touchPositionCorrectionData">@array/touch_position_correction_data_ics</item> </style> <style - name="KeyboardView.IceCreamSandwich" + name="KeyboardView.ICS" parent="KeyboardView" > <item name="android:background">@drawable/keyboard_background_holo</item> @@ -248,8 +244,8 @@ <item name="gestureTrailColor">@color/highlight_color_ics</item> </style> <style - name="MainKeyboardView.IceCreamSandwich" - parent="KeyboardView.IceCreamSandwich" + name="MainKeyboardView.ICS" + parent="KeyboardView.ICS" > <item name="autoCorrectionSpacebarLedEnabled">false</item> <item name="autoCorrectionSpacebarLedIcon">@drawable/sym_keyboard_space_led_holo</item> @@ -258,8 +254,8 @@ <item name="spacebarTextShadowColor">@color/spacebar_text_shadow_color_ics</item> </style> <style - name="MoreKeysKeyboard.IceCreamSandwich" - parent="Keyboard.IceCreamSandwich" + name="MoreKeysKeyboard.ICS" + parent="Keyboard.ICS" > <item name="keyboardTopPadding">0%p</item> <item name="keyboardBottomPadding">0%p</item> @@ -267,18 +263,18 @@ <item name="touchPositionCorrectionData">@null</item> </style> <style - name="MoreKeysKeyboardView.IceCreamSandwich" + name="MoreKeysKeyboardView.ICS" parent="MoreKeysKeyboardView" > <item name="android:background">@null</item> <item name="keyBackground">@drawable/btn_keyboard_key_popup_ics</item> <item name="verticalCorrection">@dimen/more_keys_keyboard_vertical_correction_ics</item> </style> - <style name="MoreKeysKeyboardPanelStyle.IceCreamSandwich"> + <style name="MoreKeysKeyboardPanelStyle.ICS"> <item name="android:background">@drawable/keyboard_popup_panel_background_holo</item> </style> <style - name="SuggestionStripViewStyle.IceCreamSandwich" + name="SuggestionStripViewStyle.ICS" > <item name="android:background">@drawable/keyboard_suggest_strip_holo</item> <item name="suggestionStripOption">autoCorrectBold|validTypedWordBold</item> @@ -293,16 +289,16 @@ <item name="minMoreSuggestionsWidth">@fraction/min_more_suggestions_width</item> </style> <style - name="MoreSuggestionsViewStyle.IceCreamSandwich" - parent="MoreKeysKeyboardView.IceCreamSandwich" + name="MoreSuggestionsViewStyle.ICS" + parent="MoreKeysKeyboardView.ICS" > </style> - <style name="SuggestionBackgroundStyle.IceCreamSandwich"> + <style name="SuggestionBackgroundStyle.ICS"> <item name="android:background">@drawable/btn_suggestion_ics</item> </style> <style - name="SuggestionPreviewBackgroundStyle.IceCreamSandwich" - parent="MoreKeysKeyboardPanelStyle.IceCreamSandwich" + name="SuggestionPreviewBackgroundStyle.ICS" + parent="MoreKeysKeyboardPanelStyle.ICS" > </style> <style name="MoreKeysKeyboardAnimation"> diff --git a/java/res/values/themes-gingerbread.xml b/java/res/values/themes-gb.xml similarity index 81% rename from java/res/values/themes-gingerbread.xml rename to java/res/values/themes-gb.xml index 129afdf5b5..714107192e 100644 --- a/java/res/values/themes-gingerbread.xml +++ b/java/res/values/themes-gb.xml @@ -15,12 +15,12 @@ --> <resources> - <style name="KeyboardTheme.Gingerbread" parent="KeyboardIcons"> - <item name="keyboardStyle">@style/Keyboard.Gingerbread</item> - <item name="keyboardViewStyle">@style/KeyboardView.Gingerbread</item> - <item name="mainKeyboardViewStyle">@style/MainKeyboardView.Gingerbread</item> - <item name="moreKeysKeyboardStyle">@style/MoreKeysKeyboard.Gingerbread</item> - <item name="moreKeysKeyboardViewStyle">@style/MoreKeysKeyboardView.Gingerbread</item> + <style name="KeyboardTheme.GB" parent="KeyboardIcons"> + <item name="keyboardStyle">@style/Keyboard.GB</item> + <item name="keyboardViewStyle">@style/KeyboardView.GB</item> + <item name="mainKeyboardViewStyle">@style/MainKeyboardView.GB</item> + <item name="moreKeysKeyboardStyle">@style/MoreKeysKeyboard.GB</item> + <item name="moreKeysKeyboardViewStyle">@style/MoreKeysKeyboardView.GB</item> <item name="moreKeysKeyboardPanelStyle">@style/MoreKeysKeyboardPanelStyle</item> <item name="suggestionStripViewStyle">@style/SuggestionStripViewStyle</item> <item name="moreSuggestionsViewStyle">@style/MoreSuggestionsViewStyle</item> diff --git a/java/res/values/themes-ics.xml b/java/res/values/themes-ics.xml index 1264831f31..7713789e38 100644 --- a/java/res/values/themes-ics.xml +++ b/java/res/values/themes-ics.xml @@ -15,15 +15,15 @@ --> <resources> - <style name="KeyboardTheme.IceCreamSandwich" parent="KeyboardIcons.IceCreamSandwich"> - <item name="keyboardStyle">@style/Keyboard.IceCreamSandwich</item> - <item name="keyboardViewStyle">@style/KeyboardView.IceCreamSandwich</item> - <item name="mainKeyboardViewStyle">@style/MainKeyboardView.IceCreamSandwich</item> - <item name="moreKeysKeyboardStyle">@style/MoreKeysKeyboard.IceCreamSandwich</item> - <item name="moreKeysKeyboardViewStyle">@style/MoreKeysKeyboardView.IceCreamSandwich</item> - <item name="moreKeysKeyboardPanelStyle">@style/MoreKeysKeyboardPanelStyle.IceCreamSandwich</item> - <item name="suggestionStripViewStyle">@style/SuggestionStripViewStyle.IceCreamSandwich</item> - <item name="moreSuggestionsViewStyle">@style/MoreSuggestionsViewStyle.IceCreamSandwich</item> - <item name="suggestionBackgroundStyle">@style/SuggestionBackgroundStyle.IceCreamSandwich</item> + <style name="KeyboardTheme.ICS" parent="KeyboardIcons.ICS"> + <item name="keyboardStyle">@style/Keyboard.ICS</item> + <item name="keyboardViewStyle">@style/KeyboardView.ICS</item> + <item name="mainKeyboardViewStyle">@style/MainKeyboardView.ICS</item> + <item name="moreKeysKeyboardStyle">@style/MoreKeysKeyboard.ICS</item> + <item name="moreKeysKeyboardViewStyle">@style/MoreKeysKeyboardView.ICS</item> + <item name="moreKeysKeyboardPanelStyle">@style/MoreKeysKeyboardPanelStyle.ICS</item> + <item name="suggestionStripViewStyle">@style/SuggestionStripViewStyle.ICS</item> + <item name="moreSuggestionsViewStyle">@style/MoreSuggestionsViewStyle.ICS</item> + <item name="suggestionBackgroundStyle">@style/SuggestionBackgroundStyle.ICS</item> </style> </resources> diff --git a/java/res/values/touch-position-correction.xml b/java/res/values/touch-position-correction.xml index 7df86f467c..9df517b32b 100644 --- a/java/res/values/touch-position-correction.xml +++ b/java/res/values/touch-position-correction.xml @@ -37,7 +37,7 @@ </string-array> <string-array - name="touch_position_correction_data_gingerbread" + name="touch_position_correction_data_gb" translatable="false" > <!-- First row --> @@ -57,7 +57,7 @@ </string-array> <string-array - name="touch_position_correction_data_ice_cream_sandwich" + name="touch_position_correction_data_ics" translatable="false" > <!-- First row --> diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java index ff2692d81c..098c8b3df1 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java @@ -58,8 +58,8 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions { } private static final KeyboardTheme[] KEYBOARD_THEMES = { - new KeyboardTheme(5, R.style.KeyboardTheme_IceCreamSandwich), - new KeyboardTheme(8, R.style.KeyboardTheme_Gingerbread), + new KeyboardTheme(0, R.style.KeyboardTheme_ICS), + new KeyboardTheme(1, R.style.KeyboardTheme_GB), }; private SubtypeSwitcher mSubtypeSwitcher; -- GitLab