From ca2f051cc173acc3bce384ebfe08068564bc8e07 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Thu, 26 Jan 2012 18:03:30 +0900 Subject: [PATCH] Auto generate various shift states alphabet keyboard automatically If any shift state variants of alphabet keyboard layout is not specified in KeyboardSet.Element, it will be automatically generated from base alphabet keyboard definition. This change also * Eliminates KeyboardShiftState object from Keyboard. * Removes various set shift state methods from Keyboard. * Removes KeyboardSet.Element.elementAutoGenerate attribute. * Separates "sticky" Key.backgroundType to "stickyOff" and "stickyOn" * Add preserveCase flag to smiley, .com, and labeled special keys. * Rename KeyboardShiftState class to AlphabetShiftState. * Rename some attributes from *UppercaseLetter* to *ShiftedLetterHint*. * Introduce shiftedLetterActivated to Key.keyLabelFlags Change-Id: I01a0a8efeeaa76820ae728a5bdfa8d02b6ce74b7 --- java/res/values/attrs.xml | 28 ++--- java/res/values/styles.xml | 16 +-- java/res/xml-sw600dp/key_smiley.xml | 8 +- java/res/xml-sw600dp/key_styles_common.xml | 58 +++++++-- java/res/xml-sw600dp/keys_apostrophe_dash.xml | 12 +- java/res/xml-sw600dp/row_qwerty4.xml | 4 +- java/res/xml-sw768dp/key_styles_common.xml | 64 ++++++++-- java/res/xml-sw768dp/keys_apostrophe_dash.xml | 12 +- java/res/xml-sw768dp/row_qwerty4.xml | 8 +- java/res/xml-sw768dp/rows_azerty.xml | 2 +- java/res/xml/key_styles_common.xml | 54 ++++++-- java/res/xml/keyboard_set.xml | 19 +-- java/res/xml/keys_comma_period.xml | 8 +- .../KeyCodeDescriptionMapper.java | 21 +--- .../com/android/inputmethod/keyboard/Key.java | 107 ++++++++-------- .../inputmethod/keyboard/Keyboard.java | 74 +---------- .../inputmethod/keyboard/KeyboardId.java | 16 +++ .../inputmethod/keyboard/KeyboardSet.java | 115 +++++++----------- .../keyboard/KeyboardSwitcher.java | 88 +++----------- .../inputmethod/keyboard/KeyboardView.java | 70 +++++------ .../keyboard/LatinKeyboardView.java | 1 - .../keyboard/MiniKeyboardView.java | 7 -- .../inputmethod/keyboard/MoreKeysPanel.java | 3 - .../inputmethod/keyboard/PointerTracker.java | 9 +- ...hiftState.java => AlphabetShiftState.java} | 46 +++---- .../keyboard/internal/KeyboardState.java | 12 +- .../android/inputmethod/latin/LatinIME.java | 32 +---- .../suggestions/MoreSuggestionsView.java | 5 - 28 files changed, 394 insertions(+), 505 deletions(-) rename java/src/com/android/inputmethod/keyboard/internal/{KeyboardShiftState.java => AlphabetShiftState.java} (76%) diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml index 8d00f7aa5..a5bf6f69a 100644 --- a/java/res/values/attrs.xml +++ b/java/res/values/attrs.xml @@ -60,16 +60,16 @@ - - + + - - + + @@ -79,9 +79,9 @@ - - - + + + @@ -240,7 +240,8 @@ - + + @@ -267,7 +268,7 @@ - + @@ -275,10 +276,9 @@ - - - - + + @@ -407,7 +407,5 @@ - - diff --git a/java/res/values/styles.xml b/java/res/values/styles.xml index 69637d75a..f69078288 100644 --- a/java/res/values/styles.xml +++ b/java/res/values/styles.xml @@ -39,18 +39,18 @@ @fraction/key_label_ratio @fraction/key_hint_letter_ratio @fraction/key_hint_label_ratio - @fraction/key_uppercase_letter_ratio + @fraction/key_uppercase_letter_ratio normal #FFFFFFFF #FFFFFFFF #80000000 #E0E0E4E5 - #66E0E4E5 - #CCE0E4E5 + #66E0E4E5 + #CCE0E4E5 @dimen/key_label_horizontal_padding @dimen/key_hint_letter_padding @dimen/key_popup_hint_letter_padding - @dimen/key_uppercase_letter_padding + @dimen/key_uppercase_letter_padding @layout/key_preview @drawable/keyboard_key_feedback @null @@ -181,8 +181,8 @@ #FF808080 #80000000 #E0000000 - #66000000 - #CC000000 + #66000000 + #CC000000 #FFFFFFFF