diff options
Diffstat (limited to 'java')
42 files changed, 252 insertions, 257 deletions
diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml index 77c657b09..ae47c1f82 100644 --- a/java/res/values/attrs.xml +++ b/java/res/values/attrs.xml @@ -196,17 +196,21 @@ <enum name="action" value="2" /> <enum name="sticky" value="3" /> </attr> - <!-- Whether long-pressing on this key will make it repeat. --> - <attr name="isRepeatable" format="boolean" /> + <!-- The key action flags. --> + <attr name="keyActionFlags" format="integer"> + <!-- This should be aligned with Key.ACTION_FLAGS_* --> + <flag name="isRepeatable" value="0x01" /> + <flag name="noKeyPreview" value="0x02" /> + </attr> <!-- The string of characters to output when this key is pressed. --> <attr name="keyOutputText" format="string" /> <!-- The label to display on the key. --> <attr name="keyLabel" format="string" /> <!-- The hint label to display on the key in conjunction with the label. --> <attr name="keyHintLabel" format="string" /> - <!-- The key label option. --> - <attr name="keyLabelOption" format="integer"> - <!-- This should be aligned with Key.LABEL_OPTION_* --> + <!-- The key label flags. --> + <attr name="keyLabelFlags" format="integer"> + <!-- This should be aligned with Key.LABEL_FLAGS__* --> <flag name="alignLeft" value="0x01" /> <flag name="alignRight" value="0x02" /> <flag name="alignLeftOfCenter" value="0x08" /> @@ -221,7 +225,6 @@ <flag name="withIconLeft" value="0x1000" /> <flag name="withIconRight" value="0x2000" /> <flag name="autoXScale" value="0x4000" /> - <flag name="noKeyPreview" value="0x8000" /> </attr> <!-- The icon to display on the key instead of the label. --> <attr name="keyIcon" format="enum"> @@ -248,8 +251,6 @@ </attr> <!-- The key style to specify a set of key attributes defined by <key_style/> --> <attr name="keyStyle" format="string" /> - <!-- The key is enabled and responds on press. --> - <attr name="enabled" format="boolean" /> <!-- Visual insets --> <attr name="visualInsetsLeft" format="dimension|fraction" /> <attr name="visualInsetsRight" format="dimension|fraction" /> diff --git a/java/res/xml-sw600dp/kbd_key_styles.xml b/java/res/xml-sw600dp/kbd_key_styles.xml index a9d12ed1d..1dc932ad8 100644 --- a/java/res/xml-sw600dp/kbd_key_styles.xml +++ b/java/res/xml-sw600dp/kbd_key_styles.xml @@ -33,7 +33,7 @@ <default> <key-style latin:styleName="f2PopupStyle" - latin:keyLabelOption="hasPopupHint" + latin:keyLabelFlags="hasPopupHint" latin:moreKeys="\@icon/3|\@integer/key_settings" latin:backgroundType="functional" /> </default> @@ -44,47 +44,46 @@ latin:code="@integer/key_shift" latin:keyIcon="iconShiftKey" latin:keyIconShifted="iconShiftedShiftKey" - latin:keyLabelOption="noKeyPreview" + latin:keyActionFlags="noKeyPreview" latin:backgroundType="sticky" /> <key-style latin:styleName="deleteKeyStyle" latin:code="@integer/key_delete" latin:keyIcon="iconDeleteKey" - latin:keyLabelOption="noKeyPreview" - latin:backgroundType="functional" - latin:isRepeatable="true" /> + latin:keyActionFlags="isRepeatable|noKeyPreview" + latin:backgroundType="functional" /> <key-style latin:styleName="returnKeyStyle" latin:code="@integer/key_return" latin:keyIcon="iconReturnKey" - latin:keyLabelOption="noKeyPreview" + latin:keyActionFlags="noKeyPreview" latin:backgroundType="functional" /> <key-style latin:styleName="spaceKeyStyle" latin:code="@integer/key_space" - latin:keyLabelOption="noKeyPreview" /> + latin:keyActionFlags="noKeyPreview" /> <key-style latin:styleName="nonSpecialBackgroundSpaceKeyStyle" latin:code="@integer/key_space" - latin:keyLabelOption="noKeyPreview" /> + latin:keyActionFlags="noKeyPreview" /> <key-style latin:styleName="smileyKeyStyle" latin:keyLabel=":-)" latin:keyOutputText=":-) " - latin:keyLabelOption="hasPopupHint" + latin:keyLabelFlags="hasPopupHint" latin:moreKeys="@string/more_keys_for_smiley" latin:maxMoreKeysColumn="5" /> <key-style latin:styleName="shortcutKeyStyle" latin:code="@integer/key_shortcut" latin:keyIcon="iconShortcutKey" - latin:keyLabelOption="noKeyPreview" + latin:keyActionFlags="noKeyPreview" latin:parentStyle="f2PopupStyle" /> <key-style latin:styleName="settingsKeyStyle" latin:code="@integer/key_settings" latin:keyIcon="iconSettingsKey" - latin:keyLabelOption="noKeyPreview" + latin:keyActionFlags="noKeyPreview" latin:backgroundType="functional" /> <key-style latin:styleName="tabKeyStyle" @@ -96,30 +95,30 @@ latin:styleName="toSymbolKeyStyle" latin:code="@integer/key_switch_alpha_symbol" latin:keyLabel="@string/label_to_symbol_key" - latin:keyLabelOption="noKeyPreview" + latin:keyActionFlags="noKeyPreview" latin:backgroundType="functional" /> <key-style latin:styleName="toAlphaKeyStyle" latin:code="@integer/key_switch_alpha_symbol" latin:keyLabel="@string/label_to_alpha_key" - latin:keyLabelOption="noKeyPreview" + latin:keyActionFlags="noKeyPreview" latin:backgroundType="functional" /> <key-style latin:styleName="toMoreSymbolKeyStyle" latin:code="@integer/key_shift" latin:keyLabel="@string/label_to_more_symbol_for_tablet_key" - latin:keyLabelOption="noKeyPreview" + latin:keyActionFlags="noKeyPreview" latin:backgroundType="functional" /> <key-style latin:styleName="backFromMoreSymbolKeyStyle" latin:code="@integer/key_shift" latin:keyLabel="@string/label_to_symbol_key" - latin:keyLabelOption="noKeyPreview" + latin:keyActionFlags="noKeyPreview" latin:backgroundType="functional" /> <key-style latin:styleName="comKeyStyle" latin:keyLabel="@string/keylabel_for_popular_domain" - latin:keyLabelOption="fontNormal|hasPopupHint" + latin:keyLabelFlags="fontNormal|hasPopupHint" latin:keyOutputText="@string/keylabel_for_popular_domain" latin:moreKeys="@string/more_keys_for_popular_domain" /> </merge> diff --git a/java/res/xml-sw600dp/kbd_qwerty_row4.xml b/java/res/xml-sw600dp/kbd_qwerty_row4.xml index ef0292279..54ca22b67 100644 --- a/java/res/xml-sw600dp/kbd_qwerty_row4.xml +++ b/java/res/xml-sw600dp/kbd_qwerty_row4.xml @@ -45,7 +45,7 @@ <default> <Key latin:keyLabel="/" - latin:keyLabelOption="hasUppercaseLetter" + latin:keyLabelFlags="hasUppercaseLetter" latin:keyHintLabel="\@" latin:moreKeys="\@" /> </default> diff --git a/java/res/xml-sw600dp/kbd_row3_comma_period.xml b/java/res/xml-sw600dp/kbd_row3_comma_period.xml index b84443078..6a95ca1a3 100644 --- a/java/res/xml-sw600dp/kbd_row3_comma_period.xml +++ b/java/res/xml-sw600dp/kbd_row3_comma_period.xml @@ -33,12 +33,12 @@ <default> <Key latin:keyLabel="," - latin:keyLabelOption="hasUppercaseLetter" + latin:keyLabelFlags="hasUppercaseLetter" latin:keyHintLabel="!" latin:moreKeys="!" /> <Key latin:keyLabel="." - latin:keyLabelOption="hasUppercaseLetter" + latin:keyLabelFlags="hasUppercaseLetter" latin:keyHintLabel="\?" latin:moreKeys="\?" /> </default> diff --git a/java/res/xml-sw600dp/kbd_row3_smiley.xml b/java/res/xml-sw600dp/kbd_row3_smiley.xml index f9b647cdf..c94ec0cee 100644 --- a/java/res/xml-sw600dp/kbd_row3_smiley.xml +++ b/java/res/xml-sw600dp/kbd_row3_smiley.xml @@ -35,7 +35,7 @@ > <Key latin:keyLabel="-" - latin:keyLabelOption="hasUppercaseLetter" + latin:keyLabelFlags="hasUppercaseLetter" latin:keyHintLabel="_" latin:moreKeys="_" latin:keyXPos="-8.9%p" @@ -46,7 +46,7 @@ > <Key latin:keyLabel=":" - latin:keyLabelOption="hasUppercaseLetter" + latin:keyLabelFlags="hasUppercaseLetter" latin:keyHintLabel="+" latin:moreKeys="+" latin:keyXPos="-8.9%p" diff --git a/java/res/xml-sw600dp/kbd_row4_apostrophe_dash.xml b/java/res/xml-sw600dp/kbd_row4_apostrophe_dash.xml index 9536e81da..4eb82d24a 100644 --- a/java/res/xml-sw600dp/kbd_row4_apostrophe_dash.xml +++ b/java/res/xml-sw600dp/kbd_row4_apostrophe_dash.xml @@ -33,14 +33,14 @@ > <Key latin:keyLabel="/" - latin:keyLabelOption="hasUppercaseLetter" + latin:keyLabelFlags="hasUppercaseLetter" latin:keyHintLabel=":" latin:moreKeys=":" /> </case> <default> <Key latin:keyLabel="@string/keylabel_for_apostrophe" - latin:keyLabelOption="hasUppercaseLetter" + latin:keyLabelFlags="hasUppercaseLetter" latin:keyHintLabel="@string/keyhintlabel_for_apostrophe" latin:moreKeys="@string/more_keys_for_apostrophe" /> </default> @@ -55,7 +55,7 @@ <default> <Key latin:keyLabel="@string/keylabel_for_dash" - latin:keyLabelOption="hasUppercaseLetter" + latin:keyLabelFlags="hasUppercaseLetter" latin:keyHintLabel="@string/keyhintlabel_for_dash" latin:moreKeys="@string/more_keys_for_dash" /> </default> diff --git a/java/res/xml-sw600dp/kbd_rows_arabic.xml b/java/res/xml-sw600dp/kbd_rows_arabic.xml index c2d3cd4cc..55c02f211 100644 --- a/java/res/xml-sw600dp/kbd_rows_arabic.xml +++ b/java/res/xml-sw600dp/kbd_rows_arabic.xml @@ -158,7 +158,7 @@ > <Key latin:keyLabel="-" - latin:keyLabelOption="hasUppercaseLetter" + latin:keyLabelFlags="hasUppercaseLetter" latin:keyHintLabel="_" latin:moreKeys="_" /> </case> @@ -167,7 +167,7 @@ > <Key latin:keyLabel=":" - latin:keyLabelOption="hasUppercaseLetter" + latin:keyLabelFlags="hasUppercaseLetter" latin:keyHintLabel="+" latin:moreKeys="+" /> </case> diff --git a/java/res/xml-sw600dp/kbd_rows_azerty.xml b/java/res/xml-sw600dp/kbd_rows_azerty.xml index 8ae74557c..46967899b 100644 --- a/java/res/xml-sw600dp/kbd_rows_azerty.xml +++ b/java/res/xml-sw600dp/kbd_rows_azerty.xml @@ -132,12 +132,12 @@ <default> <Key latin:keyLabel="," - latin:keyLabelOption="hasUppercaseLetter" + latin:keyLabelFlags="hasUppercaseLetter" latin:keyHintLabel="!" latin:moreKeys="!" /> <Key latin:keyLabel="." - latin:keyLabelOption="hasUppercaseLetter" + latin:keyLabelFlags="hasUppercaseLetter" latin:keyHintLabel="\?" latin:moreKeys="\?" /> </default> diff --git a/java/res/xml-sw600dp/kbd_rows_hebrew.xml b/java/res/xml-sw600dp/kbd_rows_hebrew.xml index a8adbd34c..4166745b7 100644 --- a/java/res/xml-sw600dp/kbd_rows_hebrew.xml +++ b/java/res/xml-sw600dp/kbd_rows_hebrew.xml @@ -94,7 +94,7 @@ > <Key latin:keyLabel="-" - latin:keyLabelOption="hasUppercaseLetter" + latin:keyLabelFlags="hasUppercaseLetter" latin:keyHintLabel="_" latin:moreKeys="_" latin:keyWidth="10.0%p" /> @@ -104,7 +104,7 @@ > <Key latin:keyLabel=":" - latin:keyLabelOption="hasUppercaseLetter" + latin:keyLabelFlags="hasUppercaseLetter" latin:keyHintLabel="+" latin:moreKeys="+" latin:keyWidth="10.0%p" /> diff --git a/java/res/xml-sw600dp/kbd_rows_qwertz.xml b/java/res/xml-sw600dp/kbd_rows_qwertz.xml index 98667e09c..d7d13d5d1 100644 --- a/java/res/xml-sw600dp/kbd_rows_qwertz.xml +++ b/java/res/xml-sw600dp/kbd_rows_qwertz.xml @@ -99,12 +99,12 @@ <default> <Key latin:keyLabel="," - latin:keyLabelOption="hasUppercaseLetter" + latin:keyLabelFlags="hasUppercaseLetter" latin:keyHintLabel="!" latin:moreKeys="!" /> <Key latin:keyLabel="." - latin:keyLabelOption="hasUppercaseLetter" + latin:keyLabelFlags="hasUppercaseLetter" latin:keyHintLabel="\?" latin:moreKeys="\?" /> </default> diff --git a/java/res/xml-sw600dp/kbd_rows_russian.xml b/java/res/xml-sw600dp/kbd_rows_russian.xml index cc9ad3aa7..3395065ed 100644 --- a/java/res/xml-sw600dp/kbd_rows_russian.xml +++ b/java/res/xml-sw600dp/kbd_rows_russian.xml @@ -122,12 +122,12 @@ <default> <Key latin:keyLabel="," - latin:keyLabelOption="hasUppercaseLetter" + latin:keyLabelFlags="hasUppercaseLetter" latin:keyHintLabel="!" latin:moreKeys="!" /> <Key latin:keyLabel="." - latin:keyLabelOption="hasUppercaseLetter" + latin:keyLabelFlags="hasUppercaseLetter" latin:keyHintLabel="\?" latin:moreKeys="\?" /> </default> diff --git a/java/res/xml-sw768dp/kbd_key_styles.xml b/java/res/xml-sw768dp/kbd_key_styles.xml index 4e19509e7..0d8907a2f 100644 --- a/java/res/xml-sw768dp/kbd_key_styles.xml +++ b/java/res/xml-sw768dp/kbd_key_styles.xml @@ -26,82 +26,85 @@ latin:code="@integer/key_shift" latin:keyIcon="iconShiftKey" latin:keyIconShifted="iconShiftedShiftKey" - latin:keyLabelOption="noKeyPreview" + latin:keyActionFlags="noKeyPreview" latin:backgroundType="sticky" /> <key-style latin:styleName="deleteKeyStyle" latin:code="@integer/key_delete" latin:keyIcon="iconDeleteKey" - latin:keyLabelOption="noKeyPreview" - latin:backgroundType="functional" - latin:isRepeatable="true" /> + latin:keyActionFlags="isRepeatable|noKeyPreview" + latin:backgroundType="functional" /> <key-style latin:styleName="returnKeyStyle" latin:code="@integer/key_return" latin:keyIcon="iconReturnKey" - latin:keyLabelOption="noKeyPreview" + latin:keyActionFlags="noKeyPreview" latin:backgroundType="functional" /> <key-style latin:styleName="spaceKeyStyle" latin:code="@integer/key_space" - latin:keyLabelOption="noKeyPreview" /> + latin:keyActionFlags="noKeyPreview" /> <key-style latin:styleName="nonSpecialBackgroundSpaceKeyStyle" latin:code="@integer/key_space" - latin:keyLabelOption="noKeyPreview" /> + latin:keyActionFlags="noKeyPreview" /> <key-style latin:styleName="smileyKeyStyle" latin:keyLabel=":-)" latin:keyOutputText=":-) " - latin:keyLabelOption="hasPopupHint" + latin:keyLabelFlags="hasPopupHint" latin:moreKeys="@string/more_keys_for_smiley" latin:maxMoreKeysColumn="5" /> <key-style latin:styleName="settingsKeyStyle" latin:code="@integer/key_settings" latin:keyIcon="iconSettingsKey" - latin:keyLabelOption="noKeyPreview" + latin:keyActionFlags="noKeyPreview" latin:backgroundType="functional" /> <key-style latin:styleName="shortcutKeyStyle" latin:code="@integer/key_shortcut" latin:keyIcon="iconShortcutKey" - latin:keyLabelOption="noKeyPreview" + latin:keyActionFlags="noKeyPreview" latin:backgroundType="functional" /> <key-style latin:styleName="tabKeyStyle" latin:code="@integer/key_tab" latin:keyLabel="@string/label_tab_key" - latin:keyLabelOption="fontNormal" + latin:keyLabelFlags="fontNormal" latin:backgroundType="functional" /> <key-style latin:styleName="toSymbolKeyStyle" latin:code="@integer/key_switch_alpha_symbol" latin:keyLabel="@string/label_to_symbol_key" - latin:keyLabelOption="fontNormal|noKeyPreview" + latin:keyLabelFlags="fontNormal" + latin:keyActionFlags="noKeyPreview" latin:backgroundType="functional" /> <key-style latin:styleName="toAlphaKeyStyle" latin:code="@integer/key_switch_alpha_symbol" latin:keyLabel="@string/label_to_alpha_key" - latin:keyLabelOption="fontNormal|noKeyPreview" + latin:keyLabelFlags="fontNormal" + latin:keyActionFlags="noKeyPreview" latin:backgroundType="functional" /> <key-style latin:styleName="toMoreSymbolKeyStyle" latin:code="@integer/key_shift" latin:keyLabel="@string/label_to_more_symbol_for_tablet_key" - latin:keyLabelOption="fontNormal|noKeyPreview" + latin:keyLabelFlags="fontNormal" + latin:keyActionFlags="noKeyPreview" latin:backgroundType="functional" /> <key-style latin:styleName="backFromMoreSymbolKeyStyle" latin:code="@integer/key_shift" latin:keyLabel="@string/label_to_symbol_key" - latin:keyLabelOption="fontNormal|noKeyPreview" + latin:keyLabelFlags="fontNormal" + latin:keyActionFlags="noKeyPreview" latin:backgroundType="functional" /> <key-style latin:styleName="comKeyStyle" latin:keyLabel="@string/keylabel_for_popular_domain" - latin:keyLabelOption="fontNormal|hasPopupHint" + latin:keyLabelFlags="fontNormal|hasPopupHint" latin:keyOutputText="@string/keylabel_for_popular_domain" latin:moreKeys="@string/more_keys_for_popular_domain" /> </merge> diff --git a/java/res/xml-sw768dp/kbd_qwerty_row1.xml b/java/res/xml-sw768dp/kbd_qwerty_row1.xml index 14b8bddfb..de9101331 100644 --- a/java/res/xml-sw768dp/kbd_qwerty_row1.xml +++ b/java/res/xml-sw768dp/kbd_qwerty_row1.xml @@ -26,7 +26,7 @@ > <Key latin:keyStyle="tabKeyStyle" - latin:keyLabelOption="alignLeft" + latin:keyLabelFlags="alignLeft" latin:keyWidth="7.969%p" /> <Key latin:keyLabel="q" diff --git a/java/res/xml-sw768dp/kbd_qwerty_row2.xml b/java/res/xml-sw768dp/kbd_qwerty_row2.xml index 2c312a328..1129ecdba 100644 --- a/java/res/xml-sw768dp/kbd_qwerty_row2.xml +++ b/java/res/xml-sw768dp/kbd_qwerty_row2.xml @@ -26,7 +26,7 @@ > <Key latin:keyStyle="toSymbolKeyStyle" - latin:keyLabelOption="alignLeft" + latin:keyLabelFlags="alignLeft" latin:keyWidth="11.172%p"/> <Key latin:keyLabel="a" diff --git a/java/res/xml-sw768dp/kbd_qwerty_row4.xml b/java/res/xml-sw768dp/kbd_qwerty_row4.xml index e35e47d83..1f00dff84 100644 --- a/java/res/xml-sw768dp/kbd_qwerty_row4.xml +++ b/java/res/xml-sw768dp/kbd_qwerty_row4.xml @@ -57,7 +57,7 @@ > <Key latin:keyLabel=":" - latin:keyLabelOption="hasUppercaseLetter" + latin:keyLabelFlags="hasUppercaseLetter" latin:keyHintLabel="+" latin:moreKeys="+" /> </case> @@ -76,7 +76,7 @@ <default> <Key latin:keyLabel="/" - latin:keyLabelOption="hasUppercaseLetter" + latin:keyLabelFlags="hasUppercaseLetter" latin:keyHintLabel="\@" latin:moreKeys="\@" /> </default> diff --git a/java/res/xml-sw768dp/kbd_row3_comma_period.xml b/java/res/xml-sw768dp/kbd_row3_comma_period.xml index b84443078..6a95ca1a3 100644 --- a/java/res/xml-sw768dp/kbd_row3_comma_period.xml +++ b/java/res/xml-sw768dp/kbd_row3_comma_period.xml @@ -33,12 +33,12 @@ <default> <Key latin:keyLabel="," - latin:keyLabelOption="hasUppercaseLetter" + latin:keyLabelFlags="hasUppercaseLetter" latin:keyHintLabel="!" latin:moreKeys="!" /> <Key latin:keyLabel="." - latin:keyLabelOption="hasUppercaseLetter" + latin:keyLabelFlags="hasUppercaseLetter" latin:keyHintLabel="\?" latin:moreKeys="\?" /> </default> diff --git a/java/res/xml-sw768dp/kbd_row4_apostrophe_dash.xml b/java/res/xml-sw768dp/kbd_row4_apostrophe_dash.xml index 9536e81da..4eb82d24a 100644 --- a/java/res/xml-sw768dp/kbd_row4_apostrophe_dash.xml +++ b/java/res/xml-sw768dp/kbd_row4_apostrophe_dash.xml @@ -33,14 +33,14 @@ > <Key latin:keyLabel="/" - latin:keyLabelOption="hasUppercaseLetter" + latin:keyLabelFlags="hasUppercaseLetter" latin:keyHintLabel=":" latin:moreKeys=":" /> </case> <default> <Key latin:keyLabel="@string/keylabel_for_apostrophe" - latin:keyLabelOption="hasUppercaseLetter" + latin:keyLabelFlags="hasUppercaseLetter" latin:keyHintLabel="@string/keyhintlabel_for_apostrophe" latin:moreKeys="@string/more_keys_for_apostrophe" /> </default> @@ -55,7 +55,7 @@ <default> <Key latin:keyLabel="@string/keylabel_for_dash" - latin:keyLabelOption="hasUppercaseLetter" + latin:keyLabelFlags="hasUppercaseLetter" latin:keyHintLabel="@string/keyhintlabel_for_dash" latin:moreKeys="@string/more_keys_for_dash" /> </default> diff --git a/java/res/xml-sw768dp/kbd_rows_arabic.xml b/java/res/xml-sw768dp/kbd_rows_arabic.xml index 7ec36fd94..412d5d98a 100644 --- a/java/res/xml-sw768dp/kbd_rows_arabic.xml +++ b/java/res/xml-sw768dp/kbd_rows_arabic.xml @@ -28,7 +28,7 @@ > <Key latin:keyStyle="tabKeyStyle" - latin:keyLabelOption="alignLeft" + latin:keyLabelFlags="alignLeft" latin:keyWidth="7.500%p" /> <!-- \u0636: ARABIC LETTER DAD --> <Key @@ -84,7 +84,7 @@ > <Key latin:keyStyle="toSymbolKeyStyle" - latin:keyLabelOption="alignLeft" + latin:keyLabelFlags="alignLeft" latin:keyWidth="9.375%p" /> <!-- \u0634: ARABIC LETTER SHEEN \u069c: ARABIC LETTER SEEN WITH THREE DOTS BELOW AND THREE DOTS ABOVE --> diff --git a/java/res/xml-sw768dp/kbd_rows_azerty.xml b/java/res/xml-sw768dp/kbd_rows_azerty.xml index 4659d9924..3edfb7e5b 100644 --- a/java/res/xml-sw768dp/kbd_rows_azerty.xml +++ b/java/res/xml-sw768dp/kbd_rows_azerty.xml @@ -28,7 +28,7 @@ > <Key latin:keyStyle="tabKeyStyle" - latin:keyLabelOption="alignLeft" + latin:keyLabelFlags="alignLeft" latin:keyWidth="7.969%p" /> <Key latin:keyLabel="a" @@ -70,7 +70,7 @@ > <Key latin:keyStyle="toSymbolKeyStyle" - latin:keyLabelOption="alignLeft" + latin:keyLabelFlags="alignLeft" latin:keyWidth="10.167%p" /> <Key latin:keyLabel="q" @@ -127,7 +127,7 @@ latin:moreKeys="@string/more_keys_for_n" /> <Key latin:keyLabel="\'" - latin:keyLabelOption="hasUppercaseLetter" + latin:keyLabelFlags="hasUppercaseLetter" latin:keyHintLabel=":" latin:moreKeys=":" /> <switch> @@ -142,12 +142,12 @@ <default> <Key latin:keyLabel="," - latin:keyLabelOption="hasUppercaseLetter" + latin:keyLabelFlags="hasUppercaseLetter" latin:keyHintLabel="!" latin:moreKeys="!" /> <Key latin:keyLabel="." - latin:keyLabelOption="hasUppercaseLetter" + latin:keyLabelFlags="hasUppercaseLetter" latin:keyHintLabel="\?" latin:moreKeys="\?" /> </default> diff --git a/java/res/xml-sw768dp/kbd_rows_hebrew.xml b/java/res/xml-sw768dp/kbd_rows_hebrew.xml index 27b39d1ae..5f4b556b6 100644 --- a/java/res/xml-sw768dp/kbd_rows_hebrew.xml +++ b/java/res/xml-sw768dp/kbd_rows_hebrew.xml @@ -28,7 +28,7 @@ > <Key latin:keyStyle="tabKeyStyle" - latin:keyLabelOption="alignLeft" + latin:keyLabelFlags="alignLeft" latin:keyWidth="7.969%p" /> <include latin:keyboardLayout="@xml/kbd_row4_apostrophe_dash" /> @@ -58,7 +58,7 @@ > <Key latin:keyStyle="toSymbolKeyStyle" - latin:keyLabelOption="alignLeft" + latin:keyLabelFlags="alignLeft" latin:keyWidth="11.172%p" /> <Key latin:keyLabel="ש" /> diff --git a/java/res/xml-sw768dp/kbd_rows_number.xml b/java/res/xml-sw768dp/kbd_rows_number.xml index c6a4193c3..1268987b5 100644 --- a/java/res/xml-sw768dp/kbd_rows_number.xml +++ b/java/res/xml-sw768dp/kbd_rows_number.xml @@ -32,7 +32,7 @@ <Row> <Key latin:keyStyle="numTabKeyStyle" - latin:keyLabelOption="alignLeft" + latin:keyLabelFlags="alignLeft" latin:keyWidth="11.172%p" /> <Key latin:keyStyle="num1KeyStyle" @@ -90,7 +90,7 @@ <Row> <Key latin:keyStyle="tabKeyStyle" - latin:keyLabelOption="alignLeft" + latin:keyLabelFlags="alignLeft" latin:keyWidth="11.172%p" /> <Key latin:keyLabel="-" diff --git a/java/res/xml-sw768dp/kbd_rows_phone.xml b/java/res/xml-sw768dp/kbd_rows_phone.xml index de363756e..1320cf0ba 100644 --- a/java/res/xml-sw768dp/kbd_rows_phone.xml +++ b/java/res/xml-sw768dp/kbd_rows_phone.xml @@ -28,7 +28,7 @@ <Row> <Key latin:keyStyle="numTabKeyStyle" - latin:keyLabelOption="alignLeft" + latin:keyLabelFlags="alignLeft" latin:keyWidth="11.172%p" /> <Key latin:keyLabel="-" diff --git a/java/res/xml-sw768dp/kbd_rows_phone_shift.xml b/java/res/xml-sw768dp/kbd_rows_phone_shift.xml index b59013d2e..e749790a0 100644 --- a/java/res/xml-sw768dp/kbd_rows_phone_shift.xml +++ b/java/res/xml-sw768dp/kbd_rows_phone_shift.xml @@ -28,7 +28,7 @@ <Row> <Key latin:keyStyle="numTabKeyStyle" - latin:keyLabelOption="alignLeft" + latin:keyLabelFlags="alignLeft" latin:keyWidth="11.172%p" /> <Key latin:keyLabel="-" diff --git a/java/res/xml-sw768dp/kbd_rows_qwertz.xml b/java/res/xml-sw768dp/kbd_rows_qwertz.xml index 82e0dd09c..3c02c8f62 100644 --- a/java/res/xml-sw768dp/kbd_rows_qwertz.xml +++ b/java/res/xml-sw768dp/kbd_rows_qwertz.xml @@ -28,7 +28,7 @@ > <Key latin:keyStyle="tabKeyStyle" - latin:keyLabelOption="alignLeft" + latin:keyLabelFlags="alignLeft" latin:keyWidth="7.969%p" /> <Key latin:keyLabel="q" @@ -103,12 +103,12 @@ <default> <Key latin:keyLabel="," - latin:keyLabelOption="hasUppercaseLetter" + latin:keyLabelFlags="hasUppercaseLetter" latin:keyHintLabel="!" latin:moreKeys="!" /> <Key latin:keyLabel="." - latin:keyLabelOption="hasUppercaseLetter" + latin:keyLabelFlags="hasUppercaseLetter" latin:keyHintLabel="\?" latin:moreKeys="\?" /> </default> diff --git a/java/res/xml-sw768dp/kbd_rows_russian.xml b/java/res/xml-sw768dp/kbd_rows_russian.xml index e5f556958..eb0baf95d 100644 --- a/java/res/xml-sw768dp/kbd_rows_russian.xml +++ b/java/res/xml-sw768dp/kbd_rows_russian.xml @@ -28,7 +28,7 @@ > <Key latin:keyStyle="tabKeyStyle" - latin:keyLabelOption="alignLeft" /> + latin:keyLabelFlags="alignLeft" /> <Key latin:keyLabel="й" /> <Key @@ -63,7 +63,7 @@ > <Key latin:keyStyle="toSymbolKeyStyle" - latin:keyLabelOption="alignLeft" + latin:keyLabelFlags="alignLeft" latin:keyWidth="9.375%p" /> <Key latin:keyLabel="ф" /> diff --git a/java/res/xml-sw768dp/kbd_rows_scandinavian.xml b/java/res/xml-sw768dp/kbd_rows_scandinavian.xml index b9d168036..c2dead230 100644 --- a/java/res/xml-sw768dp/kbd_rows_scandinavian.xml +++ b/java/res/xml-sw768dp/kbd_rows_scandinavian.xml @@ -28,7 +28,7 @@ > <Key latin:keyStyle="tabKeyStyle" - latin:keyLabelOption="alignLeft" + latin:keyLabelFlags="alignLeft" latin:keyWidth="7.500%p" /> <Key latin:keyLabel="q" @@ -72,7 +72,7 @@ > <Key latin:keyStyle="toSymbolKeyStyle" - latin:keyLabelOption="alignLeft" + latin:keyLabelFlags="alignLeft" latin:keyWidth="9.375%p" /> <Key latin:keyLabel="a" diff --git a/java/res/xml-sw768dp/kbd_rows_serbian.xml b/java/res/xml-sw768dp/kbd_rows_serbian.xml index c07176ef6..0b1773e40 100644 --- a/java/res/xml-sw768dp/kbd_rows_serbian.xml +++ b/java/res/xml-sw768dp/kbd_rows_serbian.xml @@ -28,7 +28,7 @@ > <Key latin:keyStyle="tabKeyStyle" - latin:keyLabelOption="alignLeft" /> + latin:keyLabelFlags="alignLeft" /> <Key latin:keyLabel="љ" /> <Key @@ -62,7 +62,7 @@ > <Key latin:keyStyle="toSymbolKeyStyle" - latin:keyLabelOption="alignLeft" + latin:keyLabelFlags="alignLeft" latin:keyWidth="11.172%p" /> <Key latin:keyLabel="а" /> diff --git a/java/res/xml-sw768dp/kbd_rows_spanish.xml b/java/res/xml-sw768dp/kbd_rows_spanish.xml index c737f400a..7e543b2fb 100644 --- a/java/res/xml-sw768dp/kbd_rows_spanish.xml +++ b/java/res/xml-sw768dp/kbd_rows_spanish.xml @@ -30,7 +30,7 @@ > <Key latin:keyStyle="toSymbolKeyStyle" - latin:keyLabelOption="alignLeft" + latin:keyLabelFlags="alignLeft" latin:keyWidth="10.167%p" /> <Key latin:keyLabel="a" diff --git a/java/res/xml-sw768dp/kbd_rows_symbols.xml b/java/res/xml-sw768dp/kbd_rows_symbols.xml index 987b10cdc..641fe1934 100644 --- a/java/res/xml-sw768dp/kbd_rows_symbols.xml +++ b/java/res/xml-sw768dp/kbd_rows_symbols.xml @@ -30,7 +30,7 @@ > <Key latin:keyStyle="tabKeyStyle" - latin:keyLabelOption="alignLeft" + latin:keyLabelFlags="alignLeft" latin:keyWidth="7.969%p" /> <Key latin:keyLabel="@string/keylabel_for_symbols_1" @@ -72,7 +72,7 @@ > <Key latin:keyStyle="toAlphaKeyStyle" - latin:keyLabelOption="alignLeft" + latin:keyLabelFlags="alignLeft" latin:keyWidth="11.172%p" /> <Key latin:keyLabel="#" /> diff --git a/java/res/xml-sw768dp/kbd_rows_symbols_shift.xml b/java/res/xml-sw768dp/kbd_rows_symbols_shift.xml index 9a9c3a276..f6b47a86f 100644 --- a/java/res/xml-sw768dp/kbd_rows_symbols_shift.xml +++ b/java/res/xml-sw768dp/kbd_rows_symbols_shift.xml @@ -30,7 +30,7 @@ > <Key latin:keyStyle="tabKeyStyle" - latin:keyLabelOption="alignLeft" + latin:keyLabelFlags="alignLeft" latin:keyWidth="7.969%p" /> <Key latin:keyLabel="~" /> @@ -65,7 +65,7 @@ > <Key latin:keyStyle="toAlphaKeyStyle" - latin:keyLabelOption="alignLeft" + latin:keyLabelFlags="alignLeft" latin:keyWidth="11.172%p" /> <Key latin:keyStyle="moreCurrency1KeyStyle" /> diff --git a/java/res/xml/kbd_key_styles.xml b/java/res/xml/kbd_key_styles.xml index 3b7c3db47..5aa8811fd 100644 --- a/java/res/xml/kbd_key_styles.xml +++ b/java/res/xml/kbd_key_styles.xml @@ -28,7 +28,7 @@ > <key-style latin:styleName="f1PopupStyle" - latin:keyLabelOption="hasPopupHint" + latin:keyLabelFlags="hasPopupHint" latin:moreKeys="@string/more_keys_for_f1" latin:backgroundType="functional" /> </case> @@ -38,7 +38,7 @@ > <key-style latin:styleName="f1PopupStyle" - latin:keyLabelOption="hasPopupHint" + latin:keyLabelFlags="hasPopupHint" latin:moreKeys="@string/more_keys_for_f1_settings" latin:backgroundType="functional" /> </case> @@ -48,7 +48,7 @@ > <key-style latin:styleName="f1PopupStyle" - latin:keyLabelOption="hasPopupHint" + latin:keyLabelFlags="hasPopupHint" latin:moreKeys="@string/more_keys_for_f1_navigate" latin:backgroundType="functional" /> </case> @@ -56,7 +56,7 @@ <default> <key-style latin:styleName="f1PopupStyle" - latin:keyLabelOption="hasPopupHint" + latin:keyLabelFlags="hasPopupHint" latin:moreKeys="@string/more_keys_for_f1" latin:backgroundType="functional" /> </default> @@ -67,15 +67,14 @@ latin:code="@integer/key_shift" latin:keyIcon="iconShiftKey" latin:keyIconShifted="iconShiftedShiftKey" - latin:keyLabelOption="noKeyPreview" + latin:keyActionFlags="noKeyPreview" latin:backgroundType="sticky" /> <key-style latin:styleName="deleteKeyStyle" latin:code="@integer/key_delete" latin:keyIcon="iconDeleteKey" - latin:keyLabelOption="noKeyPreview" - latin:backgroundType="functional" - latin:isRepeatable="true" /> + latin:keyActionFlags="isRepeatable|noKeyPreview" + latin:backgroundType="functional" /> <!-- Return key style --> <switch> <case @@ -86,7 +85,7 @@ latin:styleName="returnKeyStyle" latin:keyLabel=":-)" latin:keyOutputText=":-) " - latin:keyLabelOption="hasPopupHint" + latin:keyLabelFlags="hasPopupHint" latin:moreKeys="@string/more_keys_for_smiley" latin:maxMoreKeysColumn="5" latin:backgroundType="functional" /> @@ -98,7 +97,8 @@ latin:styleName="returnKeyStyle" latin:code="@integer/key_return" latin:keyLabel="@string/label_go_key" - latin:keyLabelOption="autoXScale|noKeyPreview" + latin:keyLabelFlags="autoXScale" + latin:keyActionFlags="noKeyPreview" latin:backgroundType="action" /> </case> <case @@ -108,7 +108,8 @@ latin:styleName="returnKeyStyle" latin:code="@integer/key_return" latin:keyLabel="@string/label_next_key" - latin:keyLabelOption="autoXScale|noKeyPreview" + latin:keyLabelFlags="autoXScale" + latin:keyActionFlags="noKeyPreview" latin:backgroundType="action" /> </case> <case @@ -118,7 +119,8 @@ latin:styleName="returnKeyStyle" latin:code="@integer/key_return" latin:keyLabel="@string/label_done_key" - latin:keyLabelOption="autoXScale|noKeyPreview" + latin:keyLabelFlags="autoXScale" + latin:keyActionFlags="noKeyPreview" latin:backgroundType="action" /> </case> <case @@ -128,7 +130,8 @@ latin:styleName="returnKeyStyle" latin:code="@integer/key_return" latin:keyLabel="@string/label_send_key" - latin:keyLabelOption="autoXScale|noKeyPreview" + latin:keyLabelFlags="autoXScale" + latin:keyActionFlags="noKeyPreview" latin:backgroundType="action" /> </case> <case @@ -138,7 +141,8 @@ latin:styleName="returnKeyStyle" latin:code="@integer/key_return" latin:keyIcon="iconSearchKey" - latin:keyLabelOption="noKeyPreview" + latin:keyLabelFlags="autoXScale" + latin:keyActionFlags="noKeyPreview" latin:backgroundType="action" /> </case> <default> @@ -146,26 +150,26 @@ latin:styleName="returnKeyStyle" latin:code="@integer/key_return" latin:keyIcon="iconReturnKey" - latin:keyLabelOption="noKeyPreview" + latin:keyActionFlags="noKeyPreview" latin:backgroundType="functional" /> </default> </switch> <key-style latin:styleName="spaceKeyStyle" latin:code="@integer/key_space" - latin:keyLabelOption="noKeyPreview" + latin:keyActionFlags="noKeyPreview" latin:backgroundType="functional" /> <key-style latin:styleName="shortcutKeyStyle" latin:code="@integer/key_shortcut" latin:keyIcon="iconShortcutKey" - latin:keyLabelOption="noKeyPreview" + latin:keyActionFlags="noKeyPreview" latin:parentStyle="f1PopupStyle" /> <key-style latin:styleName="settingsKeyStyle" latin:code="@integer/key_settings" latin:keyIcon="iconSettingsKey" - latin:keyLabelOption="noKeyPreview" + latin:keyActionFlags="noKeyPreview" latin:backgroundType="functional" /> <key-style latin:styleName="tabKeyStyle" @@ -193,7 +197,8 @@ latin:code="@integer/key_switch_alpha_symbol" latin:keyIcon="iconShortcutForLabel" latin:keyLabel="@string/label_to_symbol_with_microphone_key" - latin:keyLabelOption="withIconRight|noKeyPreview" + latin:keyLabelFlags="withIconRight" + latin:keyActionFlags="noKeyPreview" latin:backgroundType="functional" /> </case> <default> @@ -201,7 +206,7 @@ latin:styleName="toSymbolKeyStyle" latin:code="@integer/key_switch_alpha_symbol" latin:keyLabel="@string/label_to_symbol_key" - latin:keyLabelOption="noKeyPreview" + latin:keyActionFlags="noKeyPreview" latin:backgroundType="functional" /> </default> </switch> @@ -209,25 +214,25 @@ latin:styleName="toAlphaKeyStyle" latin:code="@integer/key_switch_alpha_symbol" latin:keyLabel="@string/label_to_alpha_key" - latin:keyLabelOption="noKeyPreview" + latin:keyActionFlags="noKeyPreview" latin:backgroundType="functional" /> <key-style latin:styleName="toMoreSymbolKeyStyle" latin:code="@integer/key_shift" latin:keyLabel="@string/label_to_more_symbol_key" - latin:keyLabelOption="noKeyPreview" + latin:keyActionFlags="noKeyPreview" latin:backgroundType="functional" /> <key-style latin:styleName="backFromMoreSymbolKeyStyle" latin:code="@integer/key_shift" latin:keyLabel="@string/label_to_symbol_key" - latin:keyLabelOption="noKeyPreview" + latin:keyActionFlags="noKeyPreview" latin:backgroundType="functional" /> <key-style latin:styleName="punctuationKeyStyle" latin:keyLabel="." latin:keyHintLabel="@string/keyhintlabel_for_punctuation" - latin:keyLabelOption="hasPopupHint" + latin:keyLabelFlags="hasPopupHint" latin:moreKeys="@string/more_keys_for_punctuation" latin:maxMoreKeysColumn="@integer/mini_keyboard_column_for_punctuation" latin:backgroundType="functional" /> diff --git a/java/res/xml/kbd_numkey_styles.xml b/java/res/xml/kbd_numkey_styles.xml index 42c0f6488..c2ff4d50f 100644 --- a/java/res/xml/kbd_numkey_styles.xml +++ b/java/res/xml/kbd_numkey_styles.xml @@ -23,23 +23,23 @@ > <key-style latin:styleName="numKeyBaseStyle" - latin:keyLabelOption="noKeyPreview" /> + latin:keyActionFlags="noKeyPreview" /> <key-style latin:styleName="numKeyStyle" - latin:keyLabelOption="largeLetter|followKeyLetterRatio" + latin:keyLabelFlags="largeLetter|followKeyLetterRatio" latin:parentStyle="numKeyBaseStyle" /> <key-style latin:styleName="numModeKeyStyle" - latin:keyLabelOption="fontNormal|followKeyLetterRatio" + latin:keyLabelFlags="fontNormal|followKeyLetterRatio" latin:parentStyle="numKeyBaseStyle" /> <key-style latin:styleName="numFunctionalKeyStyle" - latin:keyLabelOption="largeLetter|followKeyLetterRatio" + latin:keyLabelFlags="largeLetter|followKeyLetterRatio" latin:backgroundType="functional" latin:parentStyle="numKeyBaseStyle" /> <key-style latin:styleName="numberKeyStyle" - latin:keyLabelOption="alignLeftOfCenter|hasHintLabel" + latin:keyLabelFlags="alignLeftOfCenter|hasHintLabel" latin:parentStyle="numKeyStyle" /> <key-style latin:styleName="num0KeyStyle" @@ -109,17 +109,17 @@ latin:styleName="numPauseKeyStyle" latin:code="44" latin:keyLabel="@string/label_pause_key" - latin:keyLabelOption="followKeyHintLabelRatio|autoXScale" + latin:keyLabelFlags="followKeyHintLabelRatio|autoXScale" latin:parentStyle="numKeyBaseStyle" /> <key-style latin:styleName="numWaitKeyStyle" latin:code="59" latin:keyLabel="@string/label_wait_key" - latin:keyLabelOption="followKeyHintLabelRatio|autoXScale" + latin:keyLabelFlags="followKeyHintLabelRatio|autoXScale" latin:parentStyle="numKeyBaseStyle" /> <key-style latin:styleName="numTabKeyStyle" - latin:keyLabelOption="noKeyPreview" + latin:keyActionFlags="noKeyPreview" latin:parentStyle="tabKeyStyle" /> <key-style latin:styleName="numSpaceKeyStyle" diff --git a/java/res/xml/kbd_symbols_shift_row4.xml b/java/res/xml/kbd_symbols_shift_row4.xml index 89e80e5f7..079112c78 100644 --- a/java/res/xml/kbd_symbols_shift_row4.xml +++ b/java/res/xml/kbd_symbols_shift_row4.xml @@ -33,7 +33,7 @@ latin:keyStyle="toAlphaKeyStyle" latin:keyWidth="15%p" /> <!-- Note: Neither DroidSans nor Roboto have a glyph for ‟ Double high-reversed-9 quotation mark U+201F. --> - <!-- latin:keyLabelOption="hasPopupHint" --> + <!-- latin:keyLabelFlags="hasPopupHint" --> <!-- latin:moreKeys="‟" --> <Key latin:keyLabel="„" @@ -56,7 +56,7 @@ <include latin:keyboardLayout="@xml/kbd_settings_or_tab" /> <!-- Note: Neither DroidSans nor Roboto have a glyph for ‟ Double high-reversed-9 quotation mark U+201F. --> - <!-- latin:keyLabelOption="hasPopupHint" --> + <!-- latin:keyLabelFlags="hasPopupHint" --> <!-- latin:moreKeys="‟" --> <Key latin:keyLabel="„" diff --git a/java/src/com/android/inputmethod/accessibility/AccessibilityUtils.java b/java/src/com/android/inputmethod/accessibility/AccessibilityUtils.java index 4a2542dec..dcebb1c04 100644 --- a/java/src/com/android/inputmethod/accessibility/AccessibilityUtils.java +++ b/java/src/com/android/inputmethod/accessibility/AccessibilityUtils.java @@ -116,8 +116,8 @@ public class AccessibilityUtils { * @return {@code true} if the device should not speak text (eg. * non-control) characters */ - public boolean shouldObscureInput(EditorInfo attribute) { - if (attribute == null) + public boolean shouldObscureInput(EditorInfo editorInfo) { + if (editorInfo == null) return false; // Always speak if the user is listening through headphones. @@ -125,7 +125,7 @@ public class AccessibilityUtils { return false; // Don't speak if the IME is connected to a password field. - return InputTypeCompatUtils.isPasswordInputType(attribute.inputType); + return InputTypeCompatUtils.isPasswordInputType(editorInfo.inputType); } /** @@ -159,11 +159,11 @@ public class AccessibilityUtils { * Handles speaking the "connect a headset to hear passwords" notification * when connecting to a password field. * - * @param attribute The input connection's editor info attribute. + * @param editorInfo The input connection's editor info attribute. * @param restarting Whether the connection is being restarted. */ - public void onStartInputViewInternal(EditorInfo attribute, boolean restarting) { - if (shouldObscureInput(attribute)) { + public void onStartInputViewInternal(EditorInfo editorInfo, boolean restarting) { + if (shouldObscureInput(editorInfo)) { final CharSequence text = mContext.getText(R.string.spoken_use_headphones); speak(text); } diff --git a/java/src/com/android/inputmethod/deprecated/VoiceProxy.java b/java/src/com/android/inputmethod/deprecated/VoiceProxy.java index 3f8c2ef8f..a013ebca9 100644 --- a/java/src/com/android/inputmethod/deprecated/VoiceProxy.java +++ b/java/src/com/android/inputmethod/deprecated/VoiceProxy.java @@ -695,12 +695,12 @@ public class VoiceProxy implements VoiceInput.UiListener { && !mVoiceInput.isBlacklistedField(fieldContext); } - private boolean shouldShowVoiceButton(FieldContext fieldContext, EditorInfo attribute) { + private boolean shouldShowVoiceButton(FieldContext fieldContext, EditorInfo editorInfo) { @SuppressWarnings("deprecation") final boolean noMic = Utils.inPrivateImeOptions(null, - LatinIME.IME_OPTION_NO_MICROPHONE_COMPAT, attribute) + LatinIME.IME_OPTION_NO_MICROPHONE_COMPAT, editorInfo) || Utils.inPrivateImeOptions(mService.getPackageName(), - LatinIME.IME_OPTION_NO_MICROPHONE, attribute); + LatinIME.IME_OPTION_NO_MICROPHONE, editorInfo); return ENABLE_VOICE_BUTTON && fieldCanDoVoice(fieldContext) && !noMic && SpeechRecognizer.isRecognitionAvailable(mService); } @@ -709,7 +709,7 @@ public class VoiceProxy implements VoiceInput.UiListener { return SpeechRecognizer.isRecognitionAvailable(context); } - public void loadSettings(EditorInfo attribute, SharedPreferences sp) { + public void loadSettings(EditorInfo editorInfo, SharedPreferences sp) { if (!VOICE_INSTALLED) { return; } @@ -723,7 +723,7 @@ public class VoiceProxy implements VoiceInput.UiListener { final String voiceMode = sp.getString(PREF_VOICE_MODE, mService.getString(R.string.voice_mode_main)); mVoiceButtonEnabled = !voiceMode.equals(mService.getString(R.string.voice_mode_off)) - && shouldShowVoiceButton(makeFieldContext(), attribute); + && shouldShowVoiceButton(makeFieldContext(), editorInfo); mVoiceButtonOnPrimary = voiceMode.equals(mService.getString(R.string.voice_mode_main)); } diff --git a/java/src/com/android/inputmethod/deprecated/voice/FieldContext.java b/java/src/com/android/inputmethod/deprecated/voice/FieldContext.java index 3c79cc218..fd2cf3d25 100644 --- a/java/src/com/android/inputmethod/deprecated/voice/FieldContext.java +++ b/java/src/com/android/inputmethod/deprecated/voice/FieldContext.java @@ -43,10 +43,10 @@ public class FieldContext { Bundle mFieldInfo; - public FieldContext(InputConnection conn, EditorInfo info, + public FieldContext(InputConnection conn, EditorInfo editorInfo, String selectedLanguage, String[] enabledLanguages) { mFieldInfo = new Bundle(); - addEditorInfoToBundle(info, mFieldInfo); + addEditorInfoToBundle(editorInfo, mFieldInfo); addInputConnectionToBundle(conn, mFieldInfo); addLanguageInfoToBundle(selectedLanguage, enabledLanguages, mFieldInfo); if (DBG) Log.i("FieldContext", "Bundle = " + mFieldInfo.toString()); diff --git a/java/src/com/android/inputmethod/keyboard/Key.java b/java/src/com/android/inputmethod/keyboard/Key.java index 5fefea77d..15c41a9f2 100644 --- a/java/src/com/android/inputmethod/keyboard/Key.java +++ b/java/src/com/android/inputmethod/keyboard/Key.java @@ -51,23 +51,22 @@ public class Key { public final CharSequence mLabel; /** Hint label to display on the key in conjunction with the label */ public final CharSequence mHintLabel; - /** Option of the label */ - private final int mLabelOption; - private static final int LABEL_OPTION_ALIGN_LEFT = 0x01; - private static final int LABEL_OPTION_ALIGN_RIGHT = 0x02; - private static final int LABEL_OPTION_ALIGN_LEFT_OF_CENTER = 0x08; - private static final int LABEL_OPTION_LARGE_LETTER = 0x10; - private static final int LABEL_OPTION_FONT_NORMAL = 0x20; - private static final int LABEL_OPTION_FONT_MONO_SPACE = 0x40; - private static final int LABEL_OPTION_FOLLOW_KEY_LETTER_RATIO = 0x80; - private static final int LABEL_OPTION_FOLLOW_KEY_HINT_LABEL_RATIO = 0x100; - private static final int LABEL_OPTION_HAS_POPUP_HINT = 0x200; - private static final int LABEL_OPTION_HAS_UPPERCASE_LETTER = 0x400; - private static final int LABEL_OPTION_HAS_HINT_LABEL = 0x800; - private static final int LABEL_OPTION_WITH_ICON_LEFT = 0x1000; - private static final int LABEL_OPTION_WITH_ICON_RIGHT = 0x2000; - private static final int LABEL_OPTION_AUTO_X_SCALE = 0x4000; - private static final int LABEL_OPTION_NO_KEY_PREVIEW = 0x8000; + /** Flags of the label */ + private final int mLabelFlags; + private static final int LABEL_FLAGS_ALIGN_LEFT = 0x01; + private static final int LABEL_FLAGS_ALIGN_RIGHT = 0x02; + private static final int LABEL_FLAGS_ALIGN_LEFT_OF_CENTER = 0x08; + private static final int LABEL_FLAGS_LARGE_LETTER = 0x10; + private static final int LABEL_FLAGS_FONT_NORMAL = 0x20; + private static final int LABEL_FLAGS_FONT_MONO_SPACE = 0x40; + private static final int LABEL_FLAGS_FOLLOW_KEY_LETTER_RATIO = 0x80; + private static final int LABEL_FLAGS_FOLLOW_KEY_HINT_LABEL_RATIO = 0x100; + private static final int LABEL_FLAGS_HAS_POPUP_HINT = 0x200; + private static final int LABEL_FLAGS_HAS_UPPERCASE_LETTER = 0x400; + private static final int LABEL_FLAGS_HAS_HINT_LABEL = 0x800; + private static final int LABEL_FLAGS_WITH_ICON_LEFT = 0x1000; + private static final int LABEL_FLAGS_WITH_ICON_RIGHT = 0x2000; + private static final int LABEL_FLAGS_AUTO_X_SCALE = 0x4000; /** Icon to display instead of a label. Icon takes precedence over a label */ private Drawable mIcon; @@ -106,8 +105,9 @@ public class Key { public static final int BACKGROUND_TYPE_ACTION = 2; public static final int BACKGROUND_TYPE_STICKY = 3; - /** Whether this key repeats itself when held down */ - public final boolean mRepeatable; + private final int mActionFlags; + private static final int ACTION_FLAGS_IS_REPEATABLE = 0x01; + private static final int ACTION_FLAGS_NO_KEY_PREVIEW = 0x02; /** The current pressed state of this key */ private boolean mPressed; @@ -182,9 +182,9 @@ public class Key { mVisualInsetsLeft = mVisualInsetsRight = 0; mWidth = width - mHorizontalGap; mHintLabel = hintLabel; - mLabelOption = 0; + mLabelFlags = 0; mBackgroundType = BACKGROUND_TYPE_NORMAL; - mRepeatable = false; + mActionFlags = 0; mMoreKeys = null; mMaxMoreKeysColumn = 0; mLabel = label; @@ -255,8 +255,7 @@ public class Key { mBackgroundType = style.getInt(keyAttr, R.styleable.Keyboard_Key_backgroundType, BACKGROUND_TYPE_NORMAL); - mRepeatable = style.getBoolean(keyAttr, R.styleable.Keyboard_Key_isRepeatable, false); - mEnabled = style.getBoolean(keyAttr, R.styleable.Keyboard_Key_enabled, true); + mActionFlags = style.getFlag(keyAttr, R.styleable.Keyboard_Key_keyActionFlags, 0); final KeyboardIconsSet iconsSet = params.mIconsSet; mVisualInsetsLeft = (int) KeyboardBuilder.getDimensionOrFraction(keyAttr, @@ -276,7 +275,7 @@ public class Key { mHintLabel = style.getText(keyAttr, R.styleable.Keyboard_Key_keyHintLabel); mLabel = style.getText(keyAttr, R.styleable.Keyboard_Key_keyLabel); - mLabelOption = style.getFlag(keyAttr, R.styleable.Keyboard_Key_keyLabelOption, 0); + mLabelFlags = style.getFlag(keyAttr, R.styleable.Keyboard_Key_keyLabelFlags, 0); mOutputText = style.getText(keyAttr, R.styleable.Keyboard_Key_keyOutputText); // Choose the first letter of the label as primary code if not // specified. @@ -318,11 +317,19 @@ public class Key { return false; } + public boolean isRepeatable() { + return (mActionFlags & ACTION_FLAGS_IS_REPEATABLE) != 0; + } + + public boolean noKeyPreview() { + return (mActionFlags & ACTION_FLAGS_NO_KEY_PREVIEW) != 0; + } + public Typeface selectTypeface(Typeface defaultTypeface) { // TODO: Handle "bold" here too? - if ((mLabelOption & LABEL_OPTION_FONT_NORMAL) != 0) { + if ((mLabelFlags & LABEL_FLAGS_FONT_NORMAL) != 0) { return Typeface.DEFAULT; - } else if ((mLabelOption & LABEL_OPTION_FONT_MONO_SPACE) != 0) { + } else if ((mLabelFlags & LABEL_FLAGS_FONT_MONO_SPACE) != 0) { return Typeface.MONOSPACE; } else { return defaultTypeface; @@ -331,12 +338,12 @@ public class Key { public int selectTextSize(int letter, int largeLetter, int label, int hintLabel) { if (mLabel.length() > 1 - && (mLabelOption & (LABEL_OPTION_FOLLOW_KEY_LETTER_RATIO - | LABEL_OPTION_FOLLOW_KEY_HINT_LABEL_RATIO)) == 0) { + && (mLabelFlags & (LABEL_FLAGS_FOLLOW_KEY_LETTER_RATIO + | LABEL_FLAGS_FOLLOW_KEY_HINT_LABEL_RATIO)) == 0) { return label; - } else if ((mLabelOption & LABEL_OPTION_FOLLOW_KEY_HINT_LABEL_RATIO) != 0) { + } else if ((mLabelFlags & LABEL_FLAGS_FOLLOW_KEY_HINT_LABEL_RATIO) != 0) { return hintLabel; - } else if ((mLabelOption & LABEL_OPTION_LARGE_LETTER) != 0) { + } else if ((mLabelFlags & LABEL_FLAGS_LARGE_LETTER) != 0) { return largeLetter; } else { return letter; @@ -344,19 +351,19 @@ public class Key { } public boolean isAlignLeft() { - return (mLabelOption & LABEL_OPTION_ALIGN_LEFT) != 0; + return (mLabelFlags & LABEL_FLAGS_ALIGN_LEFT) != 0; } public boolean isAlignRight() { - return (mLabelOption & LABEL_OPTION_ALIGN_RIGHT) != 0; + return (mLabelFlags & LABEL_FLAGS_ALIGN_RIGHT) != 0; } public boolean isAlignLeftOfCenter() { - return (mLabelOption & LABEL_OPTION_ALIGN_LEFT_OF_CENTER) != 0; + return (mLabelFlags & LABEL_FLAGS_ALIGN_LEFT_OF_CENTER) != 0; } public boolean hasPopupHint() { - return (mLabelOption & LABEL_OPTION_HAS_POPUP_HINT) != 0; + return (mLabelFlags & LABEL_FLAGS_HAS_POPUP_HINT) != 0; } public void setNeedsSpecialPopupHint(boolean needsSpecialPopupHint) { @@ -368,27 +375,23 @@ public class Key { } public boolean hasUppercaseLetter() { - return (mLabelOption & LABEL_OPTION_HAS_UPPERCASE_LETTER) != 0; + return (mLabelFlags & LABEL_FLAGS_HAS_UPPERCASE_LETTER) != 0; } public boolean hasHintLabel() { - return (mLabelOption & LABEL_OPTION_HAS_HINT_LABEL) != 0; + return (mLabelFlags & LABEL_FLAGS_HAS_HINT_LABEL) != 0; } public boolean hasLabelWithIconLeft() { - return (mLabelOption & LABEL_OPTION_WITH_ICON_LEFT) != 0; + return (mLabelFlags & LABEL_FLAGS_WITH_ICON_LEFT) != 0; } public boolean hasLabelWithIconRight() { - return (mLabelOption & LABEL_OPTION_WITH_ICON_RIGHT) != 0; + return (mLabelFlags & LABEL_FLAGS_WITH_ICON_RIGHT) != 0; } public boolean needsXScale() { - return (mLabelOption & LABEL_OPTION_AUTO_X_SCALE) != 0; - } - - public boolean noKeyPreview() { - return (mLabelOption & LABEL_OPTION_NO_KEY_PREVIEW) != 0; + return (mLabelFlags & LABEL_FLAGS_AUTO_X_SCALE) != 0; } public Drawable getIcon() { diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardId.java b/java/src/com/android/inputmethod/keyboard/KeyboardId.java index cf0637124..840857778 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardId.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardId.java @@ -58,15 +58,15 @@ public class KeyboardId { public final int mImeAction; public final String mXmlName; - public final EditorInfo mAttribute; + public final EditorInfo mEditorInfo; private final int mHashCode; public KeyboardId(String xmlName, int xmlId, Locale locale, int orientation, int width, - int mode, EditorInfo attribute, boolean hasSettingsKey, int f2KeyMode, + int mode, EditorInfo editorInfo, boolean hasSettingsKey, int f2KeyMode, boolean clobberSettingsKey, boolean shortcutKeyEnabled, boolean hasShortcutKey) { - final int inputType = (attribute != null) ? attribute.inputType : 0; - final int imeOptions = (attribute != null) ? attribute.imeOptions : 0; + final int inputType = (editorInfo != null) ? editorInfo.inputType : 0; + final int imeOptions = (editorInfo != null) ? editorInfo.imeOptions : 0; this.mLocale = locale; this.mOrientation = orientation; this.mWidth = width; @@ -89,7 +89,7 @@ public class KeyboardId { EditorInfo.IME_MASK_ACTION | EditorInfo.IME_FLAG_NO_ENTER_ACTION); this.mXmlName = xmlName; - this.mAttribute = attribute; + this.mEditorInfo = editorInfo; this.mHashCode = Arrays.hashCode(new Object[] { locale, @@ -109,7 +109,7 @@ public class KeyboardId { } public KeyboardId cloneWithNewXml(String xmlName, int xmlId) { - return new KeyboardId(xmlName, xmlId, mLocale, mOrientation, mWidth, mMode, mAttribute, + return new KeyboardId(xmlName, xmlId, mLocale, mOrientation, mWidth, mMode, mEditorInfo, false, F2KEY_MODE_NONE, false, false, false); } diff --git a/java/src/com/android/inputmethod/keyboard/PointerTracker.java b/java/src/com/android/inputmethod/keyboard/PointerTracker.java index a3ec37c1b..fb4021048 100644 --- a/java/src/com/android/inputmethod/keyboard/PointerTracker.java +++ b/java/src/com/android/inputmethod/keyboard/PointerTracker.java @@ -647,7 +647,7 @@ public class PointerTracker { private void startRepeatKey(int keyIndex) { final Key key = getKey(keyIndex); - if (key != null && key.mRepeatable) { + if (key != null && key.isRepeatable()) { onRepeatKey(keyIndex); mTimerProxy.startKeyRepeatTimer(sDelayBeforeKeyRepeatStart, keyIndex, this); mIsRepeatableKey = true; diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyStyles.java b/java/src/com/android/inputmethod/keyboard/internal/KeyStyles.java index 39fb521ea..565edb901 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyStyles.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyStyles.java @@ -40,7 +40,6 @@ public class KeyStyles { public CharSequence getText(TypedArray a, int index); public int getInt(TypedArray a, int index, int defaultValue); public int getFlag(TypedArray a, int index, int defaultValue); - public boolean getBoolean(TypedArray a, int index, boolean defaultValue); } /* package */ static class EmptyKeyStyle implements KeyStyle { @@ -68,11 +67,6 @@ public class KeyStyles { return a.getInt(index, defaultValue); } - @Override - public boolean getBoolean(TypedArray a, int index, boolean defaultValue) { - return a.getBoolean(index, defaultValue); - } - protected static CharSequence[] parseTextArray(TypedArray a, int index) { if (!a.hasValue(index)) return null; @@ -151,12 +145,6 @@ public class KeyStyles { return super.getFlag(a, index, defaultValue) | (value != null ? value : 0); } - @Override - public boolean getBoolean(TypedArray a, int index, boolean defaultValue) { - final Boolean value = (Boolean)mAttributes.get(index); - return super.getBoolean(a, index, (value != null) ? value : defaultValue); - } - private DeclaredKeyStyle() { super(); } @@ -168,14 +156,13 @@ public class KeyStyles { readText(keyAttr, R.styleable.Keyboard_Key_keyOutputText); readText(keyAttr, R.styleable.Keyboard_Key_keyHintLabel); readTextArray(keyAttr, R.styleable.Keyboard_Key_moreKeys); - readFlag(keyAttr, R.styleable.Keyboard_Key_keyLabelOption); + readFlag(keyAttr, R.styleable.Keyboard_Key_keyLabelFlags); readInt(keyAttr, R.styleable.Keyboard_Key_keyIcon); readInt(keyAttr, R.styleable.Keyboard_Key_keyIconPreview); readInt(keyAttr, R.styleable.Keyboard_Key_keyIconShifted); readInt(keyAttr, R.styleable.Keyboard_Key_maxMoreKeysColumn); readInt(keyAttr, R.styleable.Keyboard_Key_backgroundType); - readBoolean(keyAttr, R.styleable.Keyboard_Key_isRepeatable); - readBoolean(keyAttr, R.styleable.Keyboard_Key_enabled); + readFlag(keyAttr, R.styleable.Keyboard_Key_keyActionFlags); } private void readText(TypedArray a, int index) { @@ -194,11 +181,6 @@ public class KeyStyles { mAttributes.put(index, a.getInt(index, 0) | (value != null ? value : 0)); } - private void readBoolean(TypedArray a, int index) { - if (a.hasValue(index)) - mAttributes.put(index, a.getBoolean(index, false)); - } - private void readTextArray(TypedArray a, int index) { final CharSequence[] value = parseTextArray(a, index); if (value != null) diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 049b316b1..f4a1c6a1d 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -409,6 +409,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar private boolean mHasPendingStartInput; private boolean mHasPendingFinishInputView; private boolean mHasPendingFinishInput; + private EditorInfo mAppliedEditorInfo; public void startOrientationChanging() { removeMessages(MSG_PENDING_IMS_CALLBACK); @@ -424,18 +425,18 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar mHasPendingStartInput = false; } - private void executePendingImsCallback(LatinIME latinIme, EditorInfo attribute, + private void executePendingImsCallback(LatinIME latinIme, EditorInfo editorInfo, boolean restarting) { if (mHasPendingFinishInputView) latinIme.onFinishInputViewInternal(mHasPendingFinishInput); if (mHasPendingFinishInput) latinIme.onFinishInputInternal(); if (mHasPendingStartInput) - latinIme.onStartInputInternal(attribute, restarting); + latinIme.onStartInputInternal(editorInfo, restarting); resetPendingImsCallback(); } - public void onStartInput(EditorInfo attribute, boolean restarting) { + public void onStartInput(EditorInfo editorInfo, boolean restarting) { if (hasMessages(MSG_PENDING_IMS_CALLBACK)) { // Typically this is the second onStartInput after orientation changed. mHasPendingStartInput = true; @@ -446,27 +447,28 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar mPendingSuccesiveImsCallback = true; } final LatinIME latinIme = getOuterInstance(); - executePendingImsCallback(latinIme, attribute, restarting); - latinIme.onStartInputInternal(attribute, restarting); + executePendingImsCallback(latinIme, editorInfo, restarting); + latinIme.onStartInputInternal(editorInfo, restarting); } } - public void onStartInputView(EditorInfo attribute, boolean restarting) { - if (hasMessages(MSG_PENDING_IMS_CALLBACK)) { - // Typically this is the second onStartInputView after orientation changed. - resetPendingImsCallback(); - } else { - if (mPendingSuccesiveImsCallback) { - // This is the first onStartInputView after orientation changed. - mPendingSuccesiveImsCallback = false; - resetPendingImsCallback(); - sendMessageDelayed(obtainMessage(MSG_PENDING_IMS_CALLBACK), - PENDING_IMS_CALLBACK_DURATION); - } - final LatinIME latinIme = getOuterInstance(); - executePendingImsCallback(latinIme, attribute, restarting); - latinIme.onStartInputViewInternal(attribute, restarting); - } + public void onStartInputView(EditorInfo editorInfo, boolean restarting) { + if (hasMessages(MSG_PENDING_IMS_CALLBACK) && editorInfo == mAppliedEditorInfo) { + // Typically this is the second onStartInputView after orientation changed. + resetPendingImsCallback(); + } else { + if (mPendingSuccesiveImsCallback) { + // This is the first onStartInputView after orientation changed. + mPendingSuccesiveImsCallback = false; + resetPendingImsCallback(); + sendMessageDelayed(obtainMessage(MSG_PENDING_IMS_CALLBACK), + PENDING_IMS_CALLBACK_DURATION); + } + final LatinIME latinIme = getOuterInstance(); + executePendingImsCallback(latinIme, editorInfo, restarting); + latinIme.onStartInputViewInternal(editorInfo, restarting); + mAppliedEditorInfo = editorInfo; + } } public void onFinishInputView(boolean finishingInput) { @@ -476,6 +478,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar } else { final LatinIME latinIme = getOuterInstance(); latinIme.onFinishInputViewInternal(finishingInput); + mAppliedEditorInfo = null; } } @@ -703,13 +706,13 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar } @Override - public void onStartInput(EditorInfo attribute, boolean restarting) { - mHandler.onStartInput(attribute, restarting); + public void onStartInput(EditorInfo editorInfo, boolean restarting) { + mHandler.onStartInput(editorInfo, restarting); } @Override - public void onStartInputView(EditorInfo attribute, boolean restarting) { - mHandler.onStartInputView(attribute, restarting); + public void onStartInputView(EditorInfo editorInfo, boolean restarting) { + mHandler.onStartInputView(editorInfo, restarting); } @Override @@ -722,19 +725,19 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar mHandler.onFinishInput(); } - private void onStartInputInternal(EditorInfo attribute, boolean restarting) { - super.onStartInput(attribute, restarting); + private void onStartInputInternal(EditorInfo editorInfo, boolean restarting) { + super.onStartInput(editorInfo, restarting); } - private void onStartInputViewInternal(EditorInfo attribute, boolean restarting) { - super.onStartInputView(attribute, restarting); + private void onStartInputViewInternal(EditorInfo editorInfo, boolean restarting) { + super.onStartInputView(editorInfo, restarting); final KeyboardSwitcher switcher = mKeyboardSwitcher; LatinKeyboardView inputView = switcher.getKeyboardView(); if (DEBUG) { - Log.d(TAG, "onStartInputView: attribute:" + ((attribute == null) ? "none" + Log.d(TAG, "onStartInputView: editorInfo:" + ((editorInfo == null) ? "none" : String.format("inputType=0x%08x imeOptions=0x%08x", - attribute.inputType, attribute.imeOptions))); + editorInfo.inputType, editorInfo.imeOptions))); } // In landscape mode, this method gets called without the input view being created. if (inputView == null) { @@ -744,7 +747,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar // Forward this event to the accessibility utilities, if enabled. final AccessibilityUtils accessUtils = AccessibilityUtils.getInstance(); if (accessUtils.isTouchExplorationEnabled()) { - accessUtils.onStartInputViewInternal(attribute, restarting); + accessUtils.onStartInputViewInternal(editorInfo, restarting); } mSubtypeSwitcher.updateParametersOnStartInputView(); @@ -755,14 +758,14 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar // know now whether this is a password text field, because we need to know now whether we // want to enable the voice button. final VoiceProxy voiceIme = mVoiceProxy; - final int inputType = (attribute != null) ? attribute.inputType : 0; + final int inputType = (editorInfo != null) ? editorInfo.inputType : 0; voiceIme.resetVoiceStates(InputTypeCompatUtils.isPasswordInputType(inputType) || InputTypeCompatUtils.isVisiblePasswordInputType(inputType)); // The EditorInfo might have a flag that affects fullscreen mode. // Note: This call should be done by InputMethodService? updateFullscreenMode(); - initializeInputAttributes(attribute); + initializeInputAttributes(editorInfo); inputView.closing(); mEnteredText = null; @@ -778,12 +781,12 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar if (mSuggest != null && mSettingsValues.mAutoCorrectEnabled) { mSuggest.setAutoCorrectionThreshold(mSettingsValues.mAutoCorrectionThreshold); } - mVoiceProxy.loadSettings(attribute, mPrefs); + mVoiceProxy.loadSettings(editorInfo, mPrefs); // This will work only when the subtype is not supported. LanguageSwitcherProxy.loadSettings(); if (mSubtypeSwitcher.isKeyboardMode()) { - switcher.loadKeyboard(attribute, mSettingsValues); + switcher.loadKeyboard(editorInfo, mSettingsValues); } if (mSuggestionsView != null) @@ -803,10 +806,10 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar if (TRACE) Debug.startMethodTracing("/data/trace/latinime"); } - private void initializeInputAttributes(EditorInfo attribute) { - if (attribute == null) + private void initializeInputAttributes(EditorInfo editorInfo) { + if (editorInfo == null) return; - final int inputType = attribute.inputType; + final int inputType = editorInfo.inputType; if (inputType == InputType.TYPE_NULL) { // TODO: We should honor TYPE_NULL specification. Log.i(TAG, "InputType.TYPE_NULL is specified"); @@ -815,7 +818,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar final int variation = inputType & InputType.TYPE_MASK_VARIATION; if (inputClass == 0) { Log.w(TAG, String.format("Unexpected input class: inputType=0x%08x imeOptions=0x%08x", - inputType, attribute.imeOptions)); + inputType, editorInfo.imeOptions)); } mInsertSpaceOnPickSuggestionManually = false; @@ -1536,16 +1539,15 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar if ((isAlphabet(code) || mSettingsValues.isSymbolExcludedFromWordSeparators(code)) && isSuggestionsRequested() && !isCursorTouchingWord()) { if (!mHasUncommittedTypedChars) { - mHasUncommittedTypedChars = true; + // Reset entirely the composing state anyway, then start composing a new word unless + // the character is a single quote. + mHasUncommittedTypedChars = (Keyboard.CODE_SINGLE_QUOTE != code); mComposingStringBuilder.setLength(0); mWordComposer.reset(); clearSuggestions(); mComposingStateManager.onFinishComposingText(); } } - if (code == Keyboard.CODE_SINGLE_QUOTE && !isCursorTouchingWord()) { - mHasUncommittedTypedChars = false; - } final KeyboardSwitcher switcher = mKeyboardSwitcher; if (switcher.isShiftedOrShiftLocked()) { if (keyCodes == null || keyCodes[0] < Character.MIN_CODE_POINT diff --git a/java/src/com/android/inputmethod/latin/Settings.java b/java/src/com/android/inputmethod/latin/Settings.java index e5a041f11..7d6efa584 100644 --- a/java/src/com/android/inputmethod/latin/Settings.java +++ b/java/src/com/android/inputmethod/latin/Settings.java @@ -301,9 +301,9 @@ public class Settings extends InputMethodSettingsActivity return mShowSettingsKey; } - public boolean isVoiceKeyEnabled(EditorInfo attribute) { + public boolean isVoiceKeyEnabled(EditorInfo editorInfo) { final boolean shortcutImeEnabled = SubtypeSwitcher.getInstance().isShortcutImeEnabled(); - final int inputType = (attribute != null) ? attribute.inputType : 0; + final int inputType = (editorInfo != null) ? editorInfo.inputType : 0; return shortcutImeEnabled && mVoiceKeyEnabled && !InputTypeCompatUtils.isPasswordInputType(inputType); } |