diff options
author | 2012-01-26 18:03:30 +0900 | |
---|---|---|
committer | 2012-01-31 12:55:45 +0900 | |
commit | ca2f051cc173acc3bce384ebfe08068564bc8e07 (patch) | |
tree | e6521ddbe372710fd703dac4574552e8b7e96e3c /java/res/xml-sw600dp | |
parent | 3b0f2bf169c23ea94c5a0adb275ce41b5c34ea83 (diff) | |
download | latinime-ca2f051cc173acc3bce384ebfe08068564bc8e07.tar.gz latinime-ca2f051cc173acc3bce384ebfe08068564bc8e07.tar.xz latinime-ca2f051cc173acc3bce384ebfe08068564bc8e07.zip |
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
Diffstat (limited to 'java/res/xml-sw600dp')
-rw-r--r-- | java/res/xml-sw600dp/key_smiley.xml | 8 | ||||
-rw-r--r-- | java/res/xml-sw600dp/key_styles_common.xml | 58 | ||||
-rw-r--r-- | java/res/xml-sw600dp/keys_apostrophe_dash.xml | 12 | ||||
-rw-r--r-- | java/res/xml-sw600dp/row_qwerty4.xml | 4 |
4 files changed, 62 insertions, 20 deletions
diff --git a/java/res/xml-sw600dp/key_smiley.xml b/java/res/xml-sw600dp/key_smiley.xml index ee23a81ba..3430d7898 100644 --- a/java/res/xml-sw600dp/key_smiley.xml +++ b/java/res/xml-sw600dp/key_smiley.xml @@ -33,18 +33,18 @@ > <Key latin:keyLabel="-" - latin:keyLabelFlags="hasUppercaseLetter" latin:keyHintLabel="_" - latin:moreKeys="_" /> + latin:moreKeys="_" + latin:keyStyle="hasShiftedLetterHintStyle" /> </case> <case latin:imeAction="actionSearch" > <Key latin:keyLabel=":" - latin:keyLabelFlags="hasUppercaseLetter" latin:keyHintLabel="+" - latin:moreKeys="+" /> + latin:moreKeys="+" + latin:keyStyle="hasShiftedLetterHintStyle" /> </case> <default> <Key diff --git a/java/res/xml-sw600dp/key_styles_common.xml b/java/res/xml-sw600dp/key_styles_common.xml index abba592b7..b55414786 100644 --- a/java/res/xml-sw600dp/key_styles_common.xml +++ b/java/res/xml-sw600dp/key_styles_common.xml @@ -38,13 +38,51 @@ latin:backgroundType="functional" /> </default> </switch> + <switch> + <case + latin:keyboardSetElement="alphabetManualShifted|alphabetShiftLockShifted" + > + <key-style + latin:styleName="hasShiftedLetterHintStyle" + latin:keyLabelFlags="hasShiftedLetterHint|shiftedLetterActivated" /> + </case> + <default> + <key-style + latin:styleName="hasShiftedLetterHintStyle" + latin:keyLabelFlags="hasShiftedLetterHint" /> + </default> + </switch> <!-- Functional key styles --> - <key-style - latin:styleName="shiftKeyStyle" - latin:code="@integer/key_shift" - latin:keyIcon="iconShiftKey" - latin:keyActionFlags="noKeyPreview" - latin:backgroundType="sticky" /> + <switch> + <case + latin:keyboardSetElement="alphabetManualShifted|alphabetAutomaticShifted" + > + <key-style + latin:styleName="shiftKeyStyle" + latin:code="@integer/key_shift" + latin:keyIcon="iconShiftKeyShifted" + latin:keyActionFlags="noKeyPreview" + latin:backgroundType="stickyOff" /> + </case> + <case + latin:keyboardSetElement="alphabetShiftLocked|alphabetShiftLockShifted" + > + <key-style + latin:styleName="shiftKeyStyle" + latin:code="@integer/key_shift" + latin:keyIcon="iconShiftKeyShifted" + latin:keyActionFlags="noKeyPreview" + latin:backgroundType="stickyOn" /> + </case> + <default> + <key-style + latin:styleName="shiftKeyStyle" + latin:code="@integer/key_shift" + latin:keyIcon="iconShiftKey" + latin:keyActionFlags="noKeyPreview" + latin:backgroundType="stickyOff" /> + </default> + </switch> <key-style latin:styleName="deleteKeyStyle" latin:code="@integer/key_delete" @@ -69,7 +107,7 @@ latin:styleName="smileyKeyStyle" latin:keyLabel=":-)" latin:keyOutputText=":-) " - latin:keyLabelFlags="hasPopupHint" + latin:keyLabelFlags="hasPopupHint|preserveCase" latin:moreKeys="@string/more_keys_for_smiley" latin:maxMoreKeysColumn="5" /> <key-style @@ -95,30 +133,34 @@ latin:styleName="toSymbolKeyStyle" latin:code="@integer/key_switch_alpha_symbol" latin:keyLabel="@string/label_to_symbol_key" + latin:keyLabelFlags="preserveCase" 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:keyLabelFlags="preserveCase" 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:keyLabelFlags="preserveCase" latin:keyActionFlags="noKeyPreview" latin:backgroundType="functional" /> <key-style latin:styleName="backFromMoreSymbolKeyStyle" latin:code="@integer/key_shift" latin:keyLabel="@string/label_to_symbol_key" + latin:keyLabelFlags="preserveCase" latin:keyActionFlags="noKeyPreview" latin:backgroundType="functional" /> <key-style latin:styleName="comKeyStyle" latin:keyLabel="@string/keylabel_for_popular_domain" - latin:keyLabelFlags="fontNormal|hasPopupHint" + latin:keyLabelFlags="fontNormal|hasPopupHint|preserveCase" latin:keyOutputText="@string/keylabel_for_popular_domain" latin:moreKeys="@string/more_keys_for_popular_domain" /> </merge> diff --git a/java/res/xml-sw600dp/keys_apostrophe_dash.xml b/java/res/xml-sw600dp/keys_apostrophe_dash.xml index 4eb82d24a..a53c1e4ab 100644 --- a/java/res/xml-sw600dp/keys_apostrophe_dash.xml +++ b/java/res/xml-sw600dp/keys_apostrophe_dash.xml @@ -33,16 +33,16 @@ > <Key latin:keyLabel="/" - latin:keyLabelFlags="hasUppercaseLetter" latin:keyHintLabel=":" - latin:moreKeys=":" /> + latin:moreKeys=":" + latin:keyStyle="hasShiftedLetterHintStyle" /> </case> <default> <Key latin:keyLabel="@string/keylabel_for_apostrophe" - latin:keyLabelFlags="hasUppercaseLetter" latin:keyHintLabel="@string/keyhintlabel_for_apostrophe" - latin:moreKeys="@string/more_keys_for_apostrophe" /> + latin:moreKeys="@string/more_keys_for_apostrophe" + latin:keyStyle="hasShiftedLetterHintStyle" /> </default> </switch> <switch> @@ -55,9 +55,9 @@ <default> <Key latin:keyLabel="@string/keylabel_for_dash" - latin:keyLabelFlags="hasUppercaseLetter" latin:keyHintLabel="@string/keyhintlabel_for_dash" - latin:moreKeys="@string/more_keys_for_dash" /> + latin:moreKeys="@string/more_keys_for_dash" + latin:keyStyle="hasShiftedLetterHintStyle" /> </default> </switch> </merge> diff --git a/java/res/xml-sw600dp/row_qwerty4.xml b/java/res/xml-sw600dp/row_qwerty4.xml index bf6bcb1c6..b06508e37 100644 --- a/java/res/xml-sw600dp/row_qwerty4.xml +++ b/java/res/xml-sw600dp/row_qwerty4.xml @@ -45,9 +45,9 @@ <default> <Key latin:keyLabel="/" - latin:keyLabelFlags="hasUppercaseLetter" latin:keyHintLabel="\@" - latin:moreKeys="\@" /> + latin:moreKeys="\@" + latin:keyStyle="hasShiftedLetterHintStyle" /> </default> </switch> <Key |