From cd96a691b14b384face577d907f6c1aa33b47233 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Thu, 23 Jun 2011 21:55:56 +0900 Subject: [PATCH] Fix "Show settings key" option on 7" device Cherry-pic I993ac772 from Honeycomb-MR2. Bug: 4586882 Change-Id: Ie74138523a3ae7958c7bec674c49aa0ab1a72d05 --- java/res/values/attrs.xml | 8 ++ java/res/xml-sw600dp/kbd_key_styles.xml | 51 ++++--- java/res/xml-sw600dp/kbd_number.xml | 17 ++- java/res/xml-sw600dp/kbd_phone.xml | 8 +- java/res/xml-sw600dp/kbd_phone_symbols.xml | 8 +- java/res/xml-sw600dp/kbd_qwerty_f2.xml | 77 +++++++++++ java/res/xml-sw600dp/kbd_qwerty_row4.xml | 10 +- java/res/xml-sw600dp/kbd_symbols.xml | 10 +- java/res/xml-sw600dp/kbd_symbols_shift.xml | 10 +- java/res/xml/kbd_key_styles.xml | 128 ++++++++++-------- .../inputmethod/keyboard/KeyboardId.java | 41 +++++- .../keyboard/KeyboardSwitcher.java | 34 ++++- .../keyboard/internal/KeyboardParser.java | 18 ++- .../inputmethod/latin/SuggestTestsBase.java | 2 +- 14 files changed, 290 insertions(+), 132 deletions(-) create mode 100644 java/res/xml-sw600dp/kbd_qwerty_f2.xml diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml index 5c00510af..e9b6354a5 100644 --- a/java/res/values/attrs.xml +++ b/java/res/values/attrs.xml @@ -277,6 +277,14 @@ + + + + + + + + diff --git a/java/res/xml-sw600dp/kbd_key_styles.xml b/java/res/xml-sw600dp/kbd_key_styles.xml index dbff293ba..e8e80ac03 100644 --- a/java/res/xml-sw600dp/kbd_key_styles.xml +++ b/java/res/xml-sw600dp/kbd_key_styles.xml @@ -25,6 +25,23 @@ + + + + + + + + + - - - - - - - - + + - - + latin:keyWidth="0%p" /> + @@ -185,11 +184,11 @@ - + latin:keyWidth="0%p" /> + diff --git a/java/res/xml-sw600dp/kbd_phone.xml b/java/res/xml-sw600dp/kbd_phone.xml index 017d00352..4dee882e9 100644 --- a/java/res/xml-sw600dp/kbd_phone.xml +++ b/java/res/xml-sw600dp/kbd_phone.xml @@ -115,10 +115,10 @@ - + latin:keyWidth="0%p" /> + diff --git a/java/res/xml-sw600dp/kbd_phone_symbols.xml b/java/res/xml-sw600dp/kbd_phone_symbols.xml index 168e6b114..87de880d9 100644 --- a/java/res/xml-sw600dp/kbd_phone_symbols.xml +++ b/java/res/xml-sw600dp/kbd_phone_symbols.xml @@ -125,10 +125,10 @@ - + latin:keyWidth="0%p" /> + diff --git a/java/res/xml-sw600dp/kbd_qwerty_f2.xml b/java/res/xml-sw600dp/kbd_qwerty_f2.xml new file mode 100644 index 000000000..2724755b0 --- /dev/null +++ b/java/res/xml-sw600dp/kbd_qwerty_f2.xml @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/res/xml-sw600dp/kbd_qwerty_row4.xml b/java/res/xml-sw600dp/kbd_qwerty_row4.xml index 958a7ed8f..8fd65fe0e 100644 --- a/java/res/xml-sw600dp/kbd_qwerty_row4.xml +++ b/java/res/xml-sw600dp/kbd_qwerty_row4.xml @@ -154,10 +154,10 @@ - + + diff --git a/java/res/xml-sw600dp/kbd_symbols.xml b/java/res/xml-sw600dp/kbd_symbols.xml index fca97c737..77849f6fd 100644 --- a/java/res/xml-sw600dp/kbd_symbols.xml +++ b/java/res/xml-sw600dp/kbd_symbols.xml @@ -209,10 +209,10 @@ latin:keyWidth="9.750%p" /> - + + diff --git a/java/res/xml-sw600dp/kbd_symbols_shift.xml b/java/res/xml-sw600dp/kbd_symbols_shift.xml index c23681d4e..b25292f27 100644 --- a/java/res/xml-sw600dp/kbd_symbols_shift.xml +++ b/java/res/xml-sw600dp/kbd_symbols_shift.xml @@ -147,10 +147,10 @@ latin:keyStyle="spaceKeyStyle" latin:keyXPos="30.750%p" latin:keyWidth="39.750%p" /> - + + diff --git a/java/res/xml/kbd_key_styles.xml b/java/res/xml/kbd_key_styles.xml index e7d8d31b6..63d519c4c 100644 --- a/java/res/xml/kbd_key_styles.xml +++ b/java/res/xml/kbd_key_styles.xml @@ -28,13 +28,21 @@ + + + - + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - %s", TAG_CASE, + if (DEBUG) Log.d(TAG, String.format("<%s%s%s%s%s%s%s%s%s%s%s%s%s> %s", TAG_CASE, textAttr(a.getString(R.styleable.Keyboard_Case_mode), "mode"), booleanAttr(a, R.styleable.Keyboard_Case_navigateAction, "navigateAction"), booleanAttr(a, R.styleable.Keyboard_Case_passwordInput, "passwordInput"), booleanAttr(a, R.styleable.Keyboard_Case_hasSettingsKey, "hasSettingsKey"), + textAttr(KeyboardId.f2KeyModeName( + a.getInt(R.styleable.Keyboard_Case_f2KeyMode, -1)), "f2KeyMode"), + booleanAttr(a, R.styleable.Keyboard_Case_clobberSettingsKey, + "clobberSettingsKey"), booleanAttr(a, R.styleable.Keyboard_Case_voiceKeyEnabled, "voiceKeyEnabled"), booleanAttr(a, R.styleable.Keyboard_Case_hasVoiceKey, "hasVoiceKey"), textAttr(EditorInfoCompatUtils.imeOptionsName( diff --git a/tests/src/com/android/inputmethod/latin/SuggestTestsBase.java b/tests/src/com/android/inputmethod/latin/SuggestTestsBase.java index bb2a6fe40..8aadee42e 100644 --- a/tests/src/com/android/inputmethod/latin/SuggestTestsBase.java +++ b/tests/src/com/android/inputmethod/latin/SuggestTestsBase.java @@ -42,7 +42,7 @@ public class SuggestTestsBase extends AndroidTestCase { return new KeyboardId(locale.toString() + " keyboard", com.android.inputmethod.latin.R.xml.kbd_qwerty, locale, Configuration.ORIENTATION_LANDSCAPE, displayWidth, KeyboardId.MODE_TEXT, - new EditorInfo(), false, false, false, false); + new EditorInfo(), false, KeyboardId.F2KEY_MODE_NONE, false, false, false, false); } protected InputStream openTestRawResource(int resIdInTest) {