diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml index 57930c6756353321fecd1ddd9e248fb5da8cbac9..0ae7fa2abedae3034bf1db0a72abd5ff08e7912b 100644 --- a/java/res/values/attrs.xml +++ b/java/res/values/attrs.xml @@ -345,20 +345,21 @@ <declare-styleable name="KeyboardSet_Element"> <!-- This should be aligned with KeyboardId.ELEMENT_* --> <attr name="elementName" format="enum"> - <enum name="alphabet" value="0" /> - <!-- TODO: Implement alphabet variant shift keyboards - <enum name="alphabetManualTemporaryShift" value="1" /> - <enum name="alphabetAutomaticTemporaryShift" value="2" /> - <enum name="alphabetShiftLock" value="3" /> - <enum name="alphabetShiftLockShift" value="4" /> - --> - <enum name="symbols" value="5" /> - <enum name="symbolsShift" value="6" /> - <enum name="phone" value="7" /> - <enum name="phoneShift" value="8" /> - <enum name="number" value="9" /> + <enum name="alphabet" value="0" /> + <enum name="alphabetManualShifted" value="1" /> + <enum name="alphabetAutomaticShifted" value="2" /> + <enum name="alphabetShiftLocked" value="3" /> + <enum name="alphabetShiftLockShifted" value="4" /> + <enum name="symbols" value="5" /> + <enum name="symbolsShifted" value="6" /> + <enum name="phone" value="7" /> + <enum name="phoneShifted" value="8" /> + <enum name="number" value="9" /> + </attr> + <attr name="elementKeyboard" format="reference|enum"> + <!-- This should be aligned with KeyboardSet.ELEMENT_KEYBOARD_* --> + <enum name="autoGenerateFromAlphabet" value="1"/> </attr> - <attr name="elementKeyboard" format="reference" /> <!-- TODO: Add setShifted and setShiftLocked attribute. --> </declare-styleable> </resources> diff --git a/java/res/xml-ar/keyboard_set.xml b/java/res/xml-ar/keyboard_set.xml index 68dc34fe3e8d43023ff2ded0c18a5f20f9c6272c..a8aac169bba6b075452b404de6bd8f4cea824d2e 100644 --- a/java/res/xml-ar/keyboard_set.xml +++ b/java/res/xml-ar/keyboard_set.xml @@ -28,13 +28,13 @@ latin:elementName="symbols" latin:elementKeyboard="@xml/kbd_symbols" /> <Element - latin:elementName="symbolsShift" + latin:elementName="symbolsShifted" latin:elementKeyboard="@xml/kbd_symbols_shift" /> <Element latin:elementName="phone" latin:elementKeyboard="@xml/kbd_phone" /> <Element - latin:elementName="phoneShift" + latin:elementName="phoneShifted" latin:elementKeyboard="@xml/kbd_phone_shift" /> <Element latin:elementName="number" diff --git a/java/res/xml-be/keyboard_set.xml b/java/res/xml-be/keyboard_set.xml index e5c6ba35a41a1be8960ed811645b02892d5ee919..c8ee9c1620ec308af6fa9ed3fd80d533146a51f1 100644 --- a/java/res/xml-be/keyboard_set.xml +++ b/java/res/xml-be/keyboard_set.xml @@ -28,13 +28,13 @@ latin:elementName="symbols" latin:elementKeyboard="@xml/kbd_symbols" /> <Element - latin:elementName="symbolsShift" + latin:elementName="symbolsShifted" latin:elementKeyboard="@xml/kbd_symbols_shift" /> <Element latin:elementName="phone" latin:elementKeyboard="@xml/kbd_phone" /> <Element - latin:elementName="phoneShift" + latin:elementName="phoneShifted" latin:elementKeyboard="@xml/kbd_phone_shift" /> <Element latin:elementName="number" diff --git a/java/res/xml-bg/keyboard_set.xml b/java/res/xml-bg/keyboard_set.xml index a789de630e86b4144ab18564c4874f0c8ad8d7dd..5a759648d308837edfc606fae244f64a56a12af2 100644 --- a/java/res/xml-bg/keyboard_set.xml +++ b/java/res/xml-bg/keyboard_set.xml @@ -28,13 +28,13 @@ latin:elementName="symbols" latin:elementKeyboard="@xml/kbd_symbols" /> <Element - latin:elementName="symbolsShift" + latin:elementName="symbolsShifted" latin:elementKeyboard="@xml/kbd_symbols_shift" /> <Element latin:elementName="phone" latin:elementKeyboard="@xml/kbd_phone" /> <Element - latin:elementName="phoneShift" + latin:elementName="phoneShifted" latin:elementKeyboard="@xml/kbd_phone_shift" /> <Element latin:elementName="number" diff --git a/java/res/xml-cs/keyboard_set.xml b/java/res/xml-cs/keyboard_set.xml index 94076d3e0894d21f7d2f5e4003b16e09012e37ac..6b476df822fb04da22e3074a676f19aaa00725b7 100644 --- a/java/res/xml-cs/keyboard_set.xml +++ b/java/res/xml-cs/keyboard_set.xml @@ -28,13 +28,13 @@ latin:elementName="symbols" latin:elementKeyboard="@xml/kbd_symbols" /> <Element - latin:elementName="symbolsShift" + latin:elementName="symbolsShifted" latin:elementKeyboard="@xml/kbd_symbols_shift" /> <Element latin:elementName="phone" latin:elementKeyboard="@xml/kbd_phone" /> <Element - latin:elementName="phoneShift" + latin:elementName="phoneShifted" latin:elementKeyboard="@xml/kbd_phone_shift" /> <Element latin:elementName="number" diff --git a/java/res/xml-da/keyboard_set.xml b/java/res/xml-da/keyboard_set.xml index 84d126dc24d0777e7ec4ab20464950252586f03c..cf930dd05f9549debd23e4f571df454205b86941 100644 --- a/java/res/xml-da/keyboard_set.xml +++ b/java/res/xml-da/keyboard_set.xml @@ -28,13 +28,13 @@ latin:elementName="symbols" latin:elementKeyboard="@xml/kbd_symbols" /> <Element - latin:elementName="symbolsShift" + latin:elementName="symbolsShifted" latin:elementKeyboard="@xml/kbd_symbols_shift" /> <Element latin:elementName="phone" latin:elementKeyboard="@xml/kbd_phone" /> <Element - latin:elementName="phoneShift" + latin:elementName="phoneShifted" latin:elementKeyboard="@xml/kbd_phone_shift" /> <Element latin:elementName="number" diff --git a/java/res/xml-de-rZZ/keyboard_set.xml b/java/res/xml-de-rZZ/keyboard_set.xml index 2309729981c124601c5977615e7a91c62e6a3575..585dc3d6a45c92d50bdd0cdbf1dddf49b7424cb9 100644 --- a/java/res/xml-de-rZZ/keyboard_set.xml +++ b/java/res/xml-de-rZZ/keyboard_set.xml @@ -28,13 +28,13 @@ latin:elementName="symbols" latin:elementKeyboard="@xml/kbd_symbols" /> <Element - latin:elementName="symbolsShift" + latin:elementName="symbolsShifted" latin:elementKeyboard="@xml/kbd_symbols_shift" /> <Element latin:elementName="phone" latin:elementKeyboard="@xml/kbd_phone" /> <Element - latin:elementName="phoneShift" + latin:elementName="phoneShifted" latin:elementKeyboard="@xml/kbd_phone_shift" /> <Element latin:elementName="number" diff --git a/java/res/xml-de/keyboard_set.xml b/java/res/xml-de/keyboard_set.xml index c1788362039c3b0a1aea321f56958afb3be4fa64..059174ccd17a199623785ada67f637c6359e5609 100644 --- a/java/res/xml-de/keyboard_set.xml +++ b/java/res/xml-de/keyboard_set.xml @@ -28,13 +28,13 @@ latin:elementName="symbols" latin:elementKeyboard="@xml/kbd_symbols" /> <Element - latin:elementName="symbolsShift" + latin:elementName="symbolsShifted" latin:elementKeyboard="@xml/kbd_symbols_shift" /> <Element latin:elementName="phone" latin:elementKeyboard="@xml/kbd_phone" /> <Element - latin:elementName="phoneShift" + latin:elementName="phoneShifted" latin:elementKeyboard="@xml/kbd_phone_shift" /> <Element latin:elementName="number" diff --git a/java/res/xml-es/keyboard_set.xml b/java/res/xml-es/keyboard_set.xml index 77f3786375fd3e06f8d6a211db7a80172229f5b4..ec40a5a9b219f51b871df3c49cfe6a1ba4c77794 100644 --- a/java/res/xml-es/keyboard_set.xml +++ b/java/res/xml-es/keyboard_set.xml @@ -28,13 +28,13 @@ latin:elementName="symbols" latin:elementKeyboard="@xml/kbd_symbols" /> <Element - latin:elementName="symbolsShift" + latin:elementName="symbolsShifted" latin:elementKeyboard="@xml/kbd_symbols_shift" /> <Element latin:elementName="phone" latin:elementKeyboard="@xml/kbd_phone" /> <Element - latin:elementName="phoneShift" + latin:elementName="phoneShifted" latin:elementKeyboard="@xml/kbd_phone_shift" /> <Element latin:elementName="number" diff --git a/java/res/xml-et/keyboard_set.xml b/java/res/xml-et/keyboard_set.xml index 304328a70485dd970c01e800a2254c3a9e2c8823..80a9d8fab96482ef75551b40a065c9684e6dac8c 100644 --- a/java/res/xml-et/keyboard_set.xml +++ b/java/res/xml-et/keyboard_set.xml @@ -28,13 +28,13 @@ latin:elementName="symbols" latin:elementKeyboard="@xml/kbd_symbols" /> <Element - latin:elementName="symbolsShift" + latin:elementName="symbolsShifted" latin:elementKeyboard="@xml/kbd_symbols_shift" /> <Element latin:elementName="phone" latin:elementKeyboard="@xml/kbd_phone" /> <Element - latin:elementName="phoneShift" + latin:elementName="phoneShifted" latin:elementKeyboard="@xml/kbd_phone_shift" /> <Element latin:elementName="number" diff --git a/java/res/xml-fi/keyboard_set.xml b/java/res/xml-fi/keyboard_set.xml index 0c3a96d36011d220866e2357eea320be6cc871bc..cf95b5ec90d0fbd926a978dea7ccd9d7ced5677f 100644 --- a/java/res/xml-fi/keyboard_set.xml +++ b/java/res/xml-fi/keyboard_set.xml @@ -28,13 +28,13 @@ latin:elementName="symbols" latin:elementKeyboard="@xml/kbd_symbols" /> <Element - latin:elementName="symbolsShift" + latin:elementName="symbolsShifted" latin:elementKeyboard="@xml/kbd_symbols_shift" /> <Element latin:elementName="phone" latin:elementKeyboard="@xml/kbd_phone" /> <Element - latin:elementName="phoneShift" + latin:elementName="phoneShifted" latin:elementKeyboard="@xml/kbd_phone_shift" /> <Element latin:elementName="number" diff --git a/java/res/xml-fr-rCA/keyboard_set.xml b/java/res/xml-fr-rCA/keyboard_set.xml index b3bb4cc12e4e8447462a34433b9902a8436da9f9..856363ea7d6342d6c041225d064ebd91686e5ef5 100644 --- a/java/res/xml-fr-rCA/keyboard_set.xml +++ b/java/res/xml-fr-rCA/keyboard_set.xml @@ -28,13 +28,13 @@ latin:elementName="symbols" latin:elementKeyboard="@xml/kbd_symbols" /> <Element - latin:elementName="symbolsShift" + latin:elementName="symbolsShifted" latin:elementKeyboard="@xml/kbd_symbols_shift" /> <Element latin:elementName="phone" latin:elementKeyboard="@xml/kbd_phone" /> <Element - latin:elementName="phoneShift" + latin:elementName="phoneShifted" latin:elementKeyboard="@xml/kbd_phone_shift" /> <Element latin:elementName="number" diff --git a/java/res/xml-fr-rCH/keyboard_set.xml b/java/res/xml-fr-rCH/keyboard_set.xml index d6dcf7541ffbc3188c25efb1a16821613640ab0f..778754c6ffeb6422057ad1348236f04505208325 100644 --- a/java/res/xml-fr-rCH/keyboard_set.xml +++ b/java/res/xml-fr-rCH/keyboard_set.xml @@ -28,13 +28,13 @@ latin:elementName="symbols" latin:elementKeyboard="@xml/kbd_symbols" /> <Element - latin:elementName="symbolsShift" + latin:elementName="symbolsShifted" latin:elementKeyboard="@xml/kbd_symbols_shift" /> <Element latin:elementName="phone" latin:elementKeyboard="@xml/kbd_phone" /> <Element - latin:elementName="phoneShift" + latin:elementName="phoneShifted" latin:elementKeyboard="@xml/kbd_phone_shift" /> <Element latin:elementName="number" diff --git a/java/res/xml-fr/keyboard_set.xml b/java/res/xml-fr/keyboard_set.xml index b94a3f2523af6ed5c664f4a7a94863867f9520ff..ae911afa008983d031aa52077b16c31d02a299d8 100644 --- a/java/res/xml-fr/keyboard_set.xml +++ b/java/res/xml-fr/keyboard_set.xml @@ -28,13 +28,13 @@ latin:elementName="symbols" latin:elementKeyboard="@xml/kbd_symbols" /> <Element - latin:elementName="symbolsShift" + latin:elementName="symbolsShifted" latin:elementKeyboard="@xml/kbd_symbols_shift" /> <Element latin:elementName="phone" latin:elementKeyboard="@xml/kbd_phone" /> <Element - latin:elementName="phoneShift" + latin:elementName="phoneShifted" latin:elementKeyboard="@xml/kbd_phone_shift" /> <Element latin:elementName="number" diff --git a/java/res/xml-hr/keyboard_set.xml b/java/res/xml-hr/keyboard_set.xml index 1d8582c0a83c425befa75ee2d7e7e6c2a4978841..4bd81d0e89a73e14d648630e5e985f6709f01a4a 100644 --- a/java/res/xml-hr/keyboard_set.xml +++ b/java/res/xml-hr/keyboard_set.xml @@ -28,13 +28,13 @@ latin:elementName="symbols" latin:elementKeyboard="@xml/kbd_symbols" /> <Element - latin:elementName="symbolsShift" + latin:elementName="symbolsShifted" latin:elementKeyboard="@xml/kbd_symbols_shift" /> <Element latin:elementName="phone" latin:elementKeyboard="@xml/kbd_phone" /> <Element - latin:elementName="phoneShift" + latin:elementName="phoneShifted" latin:elementKeyboard="@xml/kbd_phone_shift" /> <Element latin:elementName="number" diff --git a/java/res/xml-hu/keyboard_set.xml b/java/res/xml-hu/keyboard_set.xml index 0771119236fb7abf2a8990212bedc83dfe6f2fd9..9ed1d949a0ed3e62b5143b8cf8e08f05af8f7acc 100644 --- a/java/res/xml-hu/keyboard_set.xml +++ b/java/res/xml-hu/keyboard_set.xml @@ -28,13 +28,13 @@ latin:elementName="symbols" latin:elementKeyboard="@xml/kbd_symbols" /> <Element - latin:elementName="symbolsShift" + latin:elementName="symbolsShifted" latin:elementKeyboard="@xml/kbd_symbols_shift" /> <Element latin:elementName="phone" latin:elementKeyboard="@xml/kbd_phone" /> <Element - latin:elementName="phoneShift" + latin:elementName="phoneShifted" latin:elementKeyboard="@xml/kbd_phone_shift" /> <Element latin:elementName="number" diff --git a/java/res/xml-iw/keyboard_set.xml b/java/res/xml-iw/keyboard_set.xml index ce25aae72f3d56d06c8e265fc0fd9a443b2c323f..c16a6d79dcc53c8cc9e9de17ff25f612816d3eef 100644 --- a/java/res/xml-iw/keyboard_set.xml +++ b/java/res/xml-iw/keyboard_set.xml @@ -28,13 +28,13 @@ latin:elementName="symbols" latin:elementKeyboard="@xml/kbd_symbols" /> <Element - latin:elementName="symbolsShift" + latin:elementName="symbolsShifted" latin:elementKeyboard="@xml/kbd_symbols_shift" /> <Element latin:elementName="phone" latin:elementKeyboard="@xml/kbd_phone" /> <Element - latin:elementName="phoneShift" + latin:elementName="phoneShifted" latin:elementKeyboard="@xml/kbd_phone_shift" /> <Element latin:elementName="number" diff --git a/java/res/xml-ky/keyboard_set.xml b/java/res/xml-ky/keyboard_set.xml index 7cdd0a169de3d68e0cae1fedbd902ce5828a0f5f..1bb8926dfba1211151f56a291c04f69c02ebcd0d 100644 --- a/java/res/xml-ky/keyboard_set.xml +++ b/java/res/xml-ky/keyboard_set.xml @@ -28,13 +28,13 @@ latin:elementName="symbols" latin:elementKeyboard="@xml/kbd_symbols" /> <Element - latin:elementName="symbolsShift" + latin:elementName="symbolsShifted" latin:elementKeyboard="@xml/kbd_symbols_shift" /> <Element latin:elementName="phone" latin:elementKeyboard="@xml/kbd_phone" /> <Element - latin:elementName="phoneShift" + latin:elementName="phoneShifted" latin:elementKeyboard="@xml/kbd_phone_shift" /> <Element latin:elementName="number" diff --git a/java/res/xml-nb/keyboard_set.xml b/java/res/xml-nb/keyboard_set.xml index eacda8f878621d315de086a655b8bfd3d947854d..1a36de4356e119cee73c7db8ca6c0e034e18c7d4 100644 --- a/java/res/xml-nb/keyboard_set.xml +++ b/java/res/xml-nb/keyboard_set.xml @@ -28,13 +28,13 @@ latin:elementName="symbols" latin:elementKeyboard="@xml/kbd_symbols" /> <Element - latin:elementName="symbolsShift" + latin:elementName="symbolsShifted" latin:elementKeyboard="@xml/kbd_symbols_shift" /> <Element latin:elementName="phone" latin:elementKeyboard="@xml/kbd_phone" /> <Element - latin:elementName="phoneShift" + latin:elementName="phoneShifted" latin:elementKeyboard="@xml/kbd_phone_shift" /> <Element latin:elementName="number" diff --git a/java/res/xml-pl/keyboard_set.xml b/java/res/xml-pl/keyboard_set.xml index 89bd72f1ab6d478923e00b3d2f086339076ca79e..39ee777719ee6cb91d3c0dda90971ef797e31b84 100644 --- a/java/res/xml-pl/keyboard_set.xml +++ b/java/res/xml-pl/keyboard_set.xml @@ -28,13 +28,13 @@ latin:elementName="symbols" latin:elementKeyboard="@xml/kbd_symbols" /> <Element - latin:elementName="symbolsShift" + latin:elementName="symbolsShifted" latin:elementKeyboard="@xml/kbd_symbols_shift" /> <Element latin:elementName="phone" latin:elementKeyboard="@xml/kbd_phone" /> <Element - latin:elementName="phoneShift" + latin:elementName="phoneShifted" latin:elementKeyboard="@xml/kbd_phone_shift" /> <Element latin:elementName="number" diff --git a/java/res/xml-pt/keyboard_set.xml b/java/res/xml-pt/keyboard_set.xml index de31e0be50833a36a318ee84944af002b1f68e88..bd19761d38d2a4341d55e920a4836db0d0c5fb0c 100644 --- a/java/res/xml-pt/keyboard_set.xml +++ b/java/res/xml-pt/keyboard_set.xml @@ -28,13 +28,13 @@ latin:elementName="symbols" latin:elementKeyboard="@xml/kbd_symbols" /> <Element - latin:elementName="symbolsShift" + latin:elementName="symbolsShifted" latin:elementKeyboard="@xml/kbd_symbols_shift" /> <Element latin:elementName="phone" latin:elementKeyboard="@xml/kbd_phone" /> <Element - latin:elementName="phoneShift" + latin:elementName="phoneShifted" latin:elementKeyboard="@xml/kbd_phone_shift" /> <Element latin:elementName="number" diff --git a/java/res/xml-ro/keyboard_set.xml b/java/res/xml-ro/keyboard_set.xml index 725cb52d289e09e65633fb8796a58049120ad4c9..75ca6827201c5dbfcb12f501a832011cb5bb4f00 100644 --- a/java/res/xml-ro/keyboard_set.xml +++ b/java/res/xml-ro/keyboard_set.xml @@ -28,13 +28,13 @@ latin:elementName="symbols" latin:elementKeyboard="@xml/kbd_symbols" /> <Element - latin:elementName="symbolsShift" + latin:elementName="symbolsShifted" latin:elementKeyboard="@xml/kbd_symbols_shift" /> <Element latin:elementName="phone" latin:elementKeyboard="@xml/kbd_phone" /> <Element - latin:elementName="phoneShift" + latin:elementName="phoneShifted" latin:elementKeyboard="@xml/kbd_phone_shift" /> <Element latin:elementName="number" diff --git a/java/res/xml-ru/keyboard_set.xml b/java/res/xml-ru/keyboard_set.xml index 0a158d9cccc59d01341232918020b7dcb8a8a493..8d4d277b22ae97560cf8f8bb9908b15b1a86e92e 100644 --- a/java/res/xml-ru/keyboard_set.xml +++ b/java/res/xml-ru/keyboard_set.xml @@ -28,13 +28,13 @@ latin:elementName="symbols" latin:elementKeyboard="@xml/kbd_symbols" /> <Element - latin:elementName="symbolsShift" + latin:elementName="symbolsShifted" latin:elementKeyboard="@xml/kbd_symbols_shift" /> <Element latin:elementName="phone" latin:elementKeyboard="@xml/kbd_phone" /> <Element - latin:elementName="phoneShift" + latin:elementName="phoneShifted" latin:elementKeyboard="@xml/kbd_phone_shift" /> <Element latin:elementName="number" diff --git a/java/res/xml-sk/keyboard_set.xml b/java/res/xml-sk/keyboard_set.xml index 9df01dda657fc035c5d4f6384312f47b82b55171..b73c446ef56b5dc07eb9f49b9fee1f8fb8c83dcd 100644 --- a/java/res/xml-sk/keyboard_set.xml +++ b/java/res/xml-sk/keyboard_set.xml @@ -28,13 +28,13 @@ latin:elementName="symbols" latin:elementKeyboard="@xml/kbd_symbols" /> <Element - latin:elementName="symbolsShift" + latin:elementName="symbolsShifted" latin:elementKeyboard="@xml/kbd_symbols_shift" /> <Element latin:elementName="phone" latin:elementKeyboard="@xml/kbd_phone" /> <Element - latin:elementName="phoneShift" + latin:elementName="phoneShifted" latin:elementKeyboard="@xml/kbd_phone_shift" /> <Element latin:elementName="number" diff --git a/java/res/xml-sl/keyboard_set.xml b/java/res/xml-sl/keyboard_set.xml index d2ec4c02dd164cfbc098b59b1ff1380af05f8747..b2378e2c2ffea7b900e13a8d223e1dc2fe6ef58d 100644 --- a/java/res/xml-sl/keyboard_set.xml +++ b/java/res/xml-sl/keyboard_set.xml @@ -28,13 +28,13 @@ latin:elementName="symbols" latin:elementKeyboard="@xml/kbd_symbols" /> <Element - latin:elementName="symbolsShift" + latin:elementName="symbolsShifted" latin:elementKeyboard="@xml/kbd_symbols_shift" /> <Element latin:elementName="phone" latin:elementKeyboard="@xml/kbd_phone" /> <Element - latin:elementName="phoneShift" + latin:elementName="phoneShifted" latin:elementKeyboard="@xml/kbd_phone_shift" /> <Element latin:elementName="number" diff --git a/java/res/xml-sr/keyboard_set.xml b/java/res/xml-sr/keyboard_set.xml index e72a0f23f3818056bcca43a2fafb3b3df18ecf87..729136f3a43066dca0fb61f58883c1da946b7497 100644 --- a/java/res/xml-sr/keyboard_set.xml +++ b/java/res/xml-sr/keyboard_set.xml @@ -28,13 +28,13 @@ latin:elementName="symbols" latin:elementKeyboard="@xml/kbd_symbols" /> <Element - latin:elementName="symbolsShift" + latin:elementName="symbolsShifted" latin:elementKeyboard="@xml/kbd_symbols_shift" /> <Element latin:elementName="phone" latin:elementKeyboard="@xml/kbd_phone" /> <Element - latin:elementName="phoneShift" + latin:elementName="phoneShifted" latin:elementKeyboard="@xml/kbd_phone_shift" /> <Element latin:elementName="number" diff --git a/java/res/xml-sv/keyboard_set.xml b/java/res/xml-sv/keyboard_set.xml index df06aef68f7edb18c1e2c283c87f3ad9993252d5..3d366a4439e67feccfba83c3c6d9fc2550359a6e 100644 --- a/java/res/xml-sv/keyboard_set.xml +++ b/java/res/xml-sv/keyboard_set.xml @@ -28,13 +28,13 @@ latin:elementName="symbols" latin:elementKeyboard="@xml/kbd_symbols" /> <Element - latin:elementName="symbolsShift" + latin:elementName="symbolsShifted" latin:elementKeyboard="@xml/kbd_symbols_shift" /> <Element latin:elementName="phone" latin:elementKeyboard="@xml/kbd_phone" /> <Element - latin:elementName="phoneShift" + latin:elementName="phoneShifted" latin:elementKeyboard="@xml/kbd_phone_shift" /> <Element latin:elementName="number" diff --git a/java/res/xml-tr/keyboard_set.xml b/java/res/xml-tr/keyboard_set.xml index 854ab85667347f5cf409131b1869a7512b9c85af..3c429585f7cab81760d0291d3e9452ea4756cd14 100644 --- a/java/res/xml-tr/keyboard_set.xml +++ b/java/res/xml-tr/keyboard_set.xml @@ -28,13 +28,13 @@ latin:elementName="symbols" latin:elementKeyboard="@xml/kbd_symbols" /> <Element - latin:elementName="symbolsShift" + latin:elementName="symbolsShifted" latin:elementKeyboard="@xml/kbd_symbols_shift" /> <Element latin:elementName="phone" latin:elementKeyboard="@xml/kbd_phone" /> <Element - latin:elementName="phoneShift" + latin:elementName="phoneShifted" latin:elementKeyboard="@xml/kbd_phone_shift" /> <Element latin:elementName="number" diff --git a/java/res/xml-uk/keyboard_set.xml b/java/res/xml-uk/keyboard_set.xml index e5ba43b236f37535851b3cb4ad6a6915d55392fe..300eea22670c9b0cfd24cddf0fafa4856bd34e05 100644 --- a/java/res/xml-uk/keyboard_set.xml +++ b/java/res/xml-uk/keyboard_set.xml @@ -28,13 +28,13 @@ latin:elementName="symbols" latin:elementKeyboard="@xml/kbd_symbols" /> <Element - latin:elementName="symbolsShift" + latin:elementName="symbolsShifted" latin:elementKeyboard="@xml/kbd_symbols_shift" /> <Element latin:elementName="phone" latin:elementKeyboard="@xml/kbd_phone" /> <Element - latin:elementName="phoneShift" + latin:elementName="phoneShifted" latin:elementKeyboard="@xml/kbd_phone_shift" /> <Element latin:elementName="number" diff --git a/java/res/xml-vi/keyboard_set.xml b/java/res/xml-vi/keyboard_set.xml index 7f4b25d9d5aaf87de7b30d886b3fdf690f96ef17..0b92c94c1326fc39ca2d0b82187e636a98afee40 100644 --- a/java/res/xml-vi/keyboard_set.xml +++ b/java/res/xml-vi/keyboard_set.xml @@ -28,13 +28,13 @@ latin:elementName="symbols" latin:elementKeyboard="@xml/kbd_symbols" /> <Element - latin:elementName="symbolsShift" + latin:elementName="symbolsShifted" latin:elementKeyboard="@xml/kbd_symbols_shift" /> <Element latin:elementName="phone" latin:elementKeyboard="@xml/kbd_phone" /> <Element - latin:elementName="phoneShift" + latin:elementName="phoneShifted" latin:elementKeyboard="@xml/kbd_phone_shift" /> <Element latin:elementName="number" diff --git a/java/res/xml/keyboard_set.xml b/java/res/xml/keyboard_set.xml index 96f352bb2b2d26a4535927b5b71a3139e0b93530..ebdd9902eb08f9460abe968de2dde8f0c5ef4274 100644 --- a/java/res/xml/keyboard_set.xml +++ b/java/res/xml/keyboard_set.xml @@ -28,13 +28,13 @@ latin:elementName="symbols" latin:elementKeyboard="@xml/kbd_symbols" /> <Element - latin:elementName="symbolsShift" + latin:elementName="symbolsShifted" latin:elementKeyboard="@xml/kbd_symbols_shift" /> <Element latin:elementName="phone" latin:elementKeyboard="@xml/kbd_phone" /> <Element - latin:elementName="phoneShift" + latin:elementName="phoneShifted" latin:elementKeyboard="@xml/kbd_phone_shift" /> <Element latin:elementName="number" diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardId.java b/java/src/com/android/inputmethod/keyboard/KeyboardId.java index d95c3b3af0e0f7715ebfcc81e11f169fa667e0c2..edce4c6e8f52f4a008bda97dd9efa28cd0b74ead 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardId.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardId.java @@ -39,16 +39,14 @@ public class KeyboardId { public static final int MODE_NUMBER = 5; public static final int ELEMENT_ALPHABET = 0; - /* TODO: Implement alphabet variant shift keyboard. - public static final int ELEMENT_ALPHABET_MANUAL_TEMPORARY_SHIFT = 1; - public static final int ELEMENT_ALPHABET_AUTOMATIC_TEMPORARY_SHIFT = 2; - public static final int ELEMENT_ALPHABET_SHIFT_LOCK = 3; - public static final int ELEMENT_ALPHABET_SHIFT_LOCK_SHIFT = 4; - */ + public static final int ELEMENT_ALPHABET_MANUAL_SHIFTED = 1; + public static final int ELEMENT_ALPHABET_AUTOMATIC_SHIFTED = 2; + public static final int ELEMENT_ALPHABET_SHIFT_LOCKED = 3; + public static final int ELEMENT_ALPHABET_SHIFT_LOCK_SHIFTED = 4; public static final int ELEMENT_SYMBOLS = 5; - public static final int ELEMENT_SYMBOLS_SHIFT = 6; + public static final int ELEMENT_SYMBOLS_SHIFTED = 6; public static final int ELEMENT_PHONE = 7; - public static final int ELEMENT_PHONE_SHIFT = 8; + public static final int ELEMENT_PHONE_SHIFTED = 8; public static final int ELEMENT_NUMBER = 9; private static final int F2KEY_MODE_NONE = 0; @@ -60,7 +58,7 @@ public class KeyboardId { public final int mOrientation; public final int mWidth; public final int mMode; - public final int mElementState; + public final int mElement; private final int mInputType; private final int mImeOptions; private final boolean mSettingsKeyEnabled; @@ -70,14 +68,14 @@ public class KeyboardId { private final int mHashCode; - public KeyboardId(int elementState, Locale locale, int orientation, int width, int mode, + public KeyboardId(int element, Locale locale, int orientation, int width, int mode, int inputType, int imeOptions, boolean settingsKeyEnabled, boolean clobberSettingsKey, boolean shortcutKeyEnabled, boolean hasShortcutKey) { this.mLocale = locale; this.mOrientation = orientation; this.mWidth = width; this.mMode = mode; - this.mElementState = elementState; + this.mElement = element; this.mInputType = inputType; this.mImeOptions = imeOptions; this.mSettingsKeyEnabled = settingsKeyEnabled; @@ -91,7 +89,7 @@ public class KeyboardId { private static int hashCode(KeyboardId id) { return Arrays.hashCode(new Object[] { id.mOrientation, - id.mElementState, + id.mElement, id.mMode, id.mWidth, id.navigateAction(), @@ -109,7 +107,7 @@ public class KeyboardId { if (other == this) return true; return other.mOrientation == this.mOrientation - && other.mElementState == this.mElementState + && other.mElement == this.mElement && other.mMode == this.mMode && other.mWidth == this.mWidth && other.navigateAction() == this.navigateAction() @@ -123,19 +121,19 @@ public class KeyboardId { } public boolean isAlphabetKeyboard() { - return mElementState < ELEMENT_SYMBOLS; + return mElement < ELEMENT_SYMBOLS; } public boolean isSymbolsKeyboard() { - return mElementState == ELEMENT_SYMBOLS || mElementState == ELEMENT_SYMBOLS_SHIFT; + return mElement == ELEMENT_SYMBOLS || mElement == ELEMENT_SYMBOLS_SHIFTED; } public boolean isPhoneKeyboard() { - return mElementState == ELEMENT_PHONE || mElementState == ELEMENT_PHONE_SHIFT; + return mElement == ELEMENT_PHONE || mElement == ELEMENT_PHONE_SHIFTED; } public boolean isPhoneShiftKeyboard() { - return mElementState == ELEMENT_PHONE_SHIFT; + return mElement == ELEMENT_PHONE_SHIFTED; } public boolean navigateAction() { @@ -190,7 +188,7 @@ public class KeyboardId { @Override public String toString() { return String.format("[%s %s %s%d %s %s %s%s%s%s%s%s%s]", - elementStateToString(mElementState), + elementToString(mElement), mLocale, (mOrientation == 1 ? "port" : "land"), mWidth, modeName(mMode), @@ -213,19 +211,17 @@ public class KeyboardId { && TextUtils.equals(a.privateImeOptions, b.privateImeOptions); } - public static String elementStateToString(int elementState) { - switch (elementState) { + public static String elementToString(int element) { + switch (element) { case ELEMENT_ALPHABET: return "alphabet"; - /* TODO: Implement alphabet variant shift keyboard. - case ELEMENT_ALPHABET_MANUAL_TEMPORARY_SHIFT: return "alphabetManualTemporaryShift"; - case ELEMENT_ALPHABET_AUTOMATIC_TEMPORARY_SHIFT: return "alphabetAutomaticTemporaryShift"; - case ELEMENT_ALPHABET_SHIFT_LOCK: return "alphabetShiftLock"; - case ELEMENT_ALPHABET_SHIFT_LOCK_SHIFT: return "alphabetShiftLockShift"; - */ + case ELEMENT_ALPHABET_MANUAL_SHIFTED: return "alphabetManualShifted"; + case ELEMENT_ALPHABET_AUTOMATIC_SHIFTED: return "alphabetAutomaticShifted"; + case ELEMENT_ALPHABET_SHIFT_LOCKED: return "alphabetShiftLocked"; + case ELEMENT_ALPHABET_SHIFT_LOCK_SHIFTED: return "alphabetShiftLockShifted"; case ELEMENT_SYMBOLS: return "symbols"; - case ELEMENT_SYMBOLS_SHIFT: return "symbolsShift"; + case ELEMENT_SYMBOLS_SHIFTED: return "symbolsShifted"; case ELEMENT_PHONE: return "phone"; - case ELEMENT_PHONE_SHIFT: return "phoneShift"; + case ELEMENT_PHONE_SHIFTED: return "phoneShifted"; case ELEMENT_NUMBER: return "number"; default: return null; } diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardSet.java b/java/src/com/android/inputmethod/keyboard/KeyboardSet.java index 2852520445be93d37dd45527076c4d362dd264c3..f4602b8fd4944538ef39194f1815665f17ad156e 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardSet.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardSet.java @@ -22,6 +22,7 @@ import android.content.res.Resources; import android.content.res.TypedArray; import android.content.res.XmlResourceParser; import android.util.Log; +import android.util.TypedValue; import android.util.Xml; import android.view.inputmethod.EditorInfo; @@ -54,10 +55,12 @@ public class KeyboardSet { private static final String TAG_KEYBOARD_SET = TAG; private static final String TAG_ELEMENT = "Element"; + private static final int ELEMENT_KEYBOARD_AUTO_GENERATE_FROM_ALPHABET = 1; + private final Context mContext; private final Params mParams; - private static class Params { + static class Params { int mMode; int mInputType; int mImeOptions; @@ -104,16 +107,18 @@ public class KeyboardSet { } private Keyboard getKeyboard(boolean isSymbols, boolean isShift) { - final int elementState = Builder.getElementState(mParams.mMode, isSymbols, isShift); - final int xmlId = mParams.mElementKeyboards.get(elementState); - final KeyboardId id = Builder.getKeyboardId(elementState, isSymbols, mParams); + final int element = KeyboardSet.getElement(mParams.mMode, isSymbols, isShift); + // TODO: If xmlId is ELEMENT_KEYBOARD_AUTO_GENERATE_FROM_ALPHABET, auto generate the + // keyboard based on base main alphabet keyboard considering element. + final int xmlId = mParams.mElementKeyboards.get(element); + final KeyboardId id = KeyboardSet.getKeyboardId(element, isSymbols, mParams); final Keyboard keyboard = getKeyboard(mContext, xmlId, id); return keyboard; } public KeyboardId getMainKeyboardId() { - final int elementState = Builder.getElementState(mParams.mMode, false, false); - return Builder.getKeyboardId(elementState, false, mParams); + final int element = KeyboardSet.getElement(mParams.mMode, false, false); + return KeyboardSet.getKeyboardId(element, false, mParams); } private Keyboard getKeyboard(Context context, int xmlId, KeyboardId id) { @@ -147,6 +152,30 @@ public class KeyboardSet { return keyboard; } + private static int getElement(int mode, boolean isSymbols, boolean isShift) { + switch (mode) { + case KeyboardId.MODE_PHONE: + return (isSymbols && isShift) + ? KeyboardId.ELEMENT_PHONE_SHIFTED : KeyboardId.ELEMENT_PHONE; + case KeyboardId.MODE_NUMBER: + return KeyboardId.ELEMENT_NUMBER; + default: + if (isSymbols) { + return isShift + ? KeyboardId.ELEMENT_SYMBOLS_SHIFTED : KeyboardId.ELEMENT_SYMBOLS; + } + return KeyboardId.ELEMENT_ALPHABET; + } + } + + private static KeyboardId getKeyboardId(int element, boolean isSymbols, Params params) { + final boolean hasShortcutKey = params.mVoiceKeyEnabled + && (isSymbols != params.mVoiceKeyOnMain); + return new KeyboardId(element, params.mLocale, params.mOrientation, params.mWidth, + params.mMode, params.mInputType, params.mImeOptions, params.mSettingsKeyEnabled, + params.mNoSettingsKey, params.mVoiceKeyEnabled, hasShortcutKey); + } + public static class Builder { private final Context mContext; private final String mPackageName; @@ -218,31 +247,6 @@ public class KeyboardSet { return new KeyboardSet(mContext, mParams); } - // TODO: Move this method to KeyboardSet - static KeyboardId getKeyboardId(int elementState, boolean isSymbols, Params params) { - final boolean hasShortcutKey = params.mVoiceKeyEnabled - && (isSymbols != params.mVoiceKeyOnMain); - return new KeyboardId(elementState, params.mLocale, params.mOrientation, params.mWidth, - params.mMode, params.mInputType, params.mImeOptions, params.mSettingsKeyEnabled, - params.mNoSettingsKey, params.mVoiceKeyEnabled, hasShortcutKey); - } - - // TODO: Move this method to KeyboardSet - static int getElementState(int mode, boolean isSymbols, boolean isShift) { - switch (mode) { - case KeyboardId.MODE_PHONE: - return (isSymbols && isShift) - ? KeyboardId.ELEMENT_PHONE_SHIFT : KeyboardId.ELEMENT_PHONE; - case KeyboardId.MODE_NUMBER: - return KeyboardId.ELEMENT_NUMBER; - default: - if (isSymbols) { - return isShift ? KeyboardId.ELEMENT_SYMBOLS_SHIFT : KeyboardId.ELEMENT_SYMBOLS; - } - return KeyboardId.ELEMENT_ALPHABET; - } - } - private void parseKeyboardSet(Resources res, int resId) throws XmlPullParserException, IOException { final XmlResourceParser parser = res.getXml(resId); @@ -300,8 +304,14 @@ public class KeyboardSet { final int elementName = a.getInt( R.styleable.KeyboardSet_Element_elementName, 0); - final int elementKeyboard = a.getResourceId( - R.styleable.KeyboardSet_Element_elementKeyboard, 0); + final int index = R.styleable.KeyboardSet_Element_elementKeyboard; + final TypedValue v = a.peekValue(index); + final int elementKeyboard; + if (v.type == TypedValue.TYPE_REFERENCE) { + elementKeyboard = a.getResourceId(index, 0); + } else { + elementKeyboard = a.getInt(index, 0); + } mParams.mElementKeyboards.put(elementName, elementKeyboard); } finally { a.recycle(); diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java index bc8b7e3f738b6c71f39a3e0b8da0361fec447794..38c31adcee487fd589b44fb0d0e09b11f57c7fa9 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java @@ -43,6 +43,8 @@ public class KeyboardState { public void setAlphabetManualShiftedKeyboard(); public void setAlphabetAutomaticShiftedKeyboard(); public void setAlphabetShiftLockedKeyboard(); + // TODO: Add this. + //public void setAlphabetShiftLockShiftedKeyboard(); public void setSymbolsKeyboard(); public void setSymbolsShiftedKeyboard();