Add Serbian Latin keyboard
Bug: 9687668
Change-Id: I0631ab04cf33e3d454c965e98a756c31666537bf
diff --git a/java/res/xml/kbd_serbian_qwertz.xml b/java/res/xml/kbd_serbian_qwertz.xml
new file mode 100644
index 0000000..4f763b8
--- /dev/null
+++ b/java/res/xml/kbd_serbian_qwertz.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2014, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<Keyboard xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" >
+ <include latin:keyboardLayout="@xml/rows_serbian_qwertz" />
+</Keyboard>
\ No newline at end of file
diff --git a/java/res/xml/keyboard_layout_set_serbian_qwertz.xml b/java/res/xml/keyboard_layout_set_serbian_qwertz.xml
new file mode 100644
index 0000000..2c7e28b
--- /dev/null
+++ b/java/res/xml/keyboard_layout_set_serbian_qwertz.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2014, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<KeyboardLayoutSet xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" >
+ <Element
+ latin:allowRedundantMoreKeys="false"
+ latin:elementKeyboard="@xml/kbd_serbian_qwertz"
+ latin:elementName="alphabet"
+ latin:enableProximityCharsCorrection="true" />
+ <Element
+ latin:elementKeyboard="@xml/kbd_symbols"
+ latin:elementName="symbols" />
+ <Element
+ latin:elementKeyboard="@xml/kbd_symbols_shift"
+ latin:elementName="symbolsShifted" />
+ <Element
+ latin:elementKeyboard="@xml/kbd_phone"
+ latin:elementName="phone" />
+ <Element
+ latin:elementKeyboard="@xml/kbd_phone_symbols"
+ latin:elementName="phoneSymbols" />
+ <Element
+ latin:elementKeyboard="@xml/kbd_number"
+ latin:elementName="number" />
+</KeyboardLayoutSet>
\ No newline at end of file
diff --git a/java/res/xml/method.xml b/java/res/xml/method.xml
index 74ac79f..270f90c 100644
--- a/java/res/xml/method.xml
+++ b/java/res/xml/method.xml
@@ -89,7 +89,7 @@
sk: Slovak/qwerty
sl: Slovenian/qwerty
sr: Serbian/south_slavic
- (sr-Latn: Serbian/qwerty) # not yet implemented.
+ (sr_ZZ: Serbian (Latin)/serbian_qwertz) # This is a preliminary keyboard layout.
sv: Swedish/nordic
sw: Swahili/qwerty
ta_IN: Tamil (India)/tamil
@@ -661,24 +661,14 @@
android:imeSubtypeExtraValue="SupportTouchPositionCorrection,EmojiCapable"
android:isAsciiCapable="false"
/>
- <!-- TODO: Uncomment once we can handle IETF language tag with script name specified.
<subtype android:icon="@drawable/ic_ime_switcher_dark"
- android:label="@string/subtype_serbian_cyrillic"
- android:subtypeId="0xXXXXXXXX"
- android:imeSubtypeLocale="sr"
+ android:label="@string/subtype_sr_ZZ"
+ android:subtypeId="0xf4a5569c"
+ android:imeSubtypeLocale="sr_ZZ"
android:imeSubtypeMode="keyboard"
- android:imeSubtypeExtraValue="SupportTouchPositionCorrection,EmojiCapable"
- android:isAsciiCapable="false"
- />
- <subtype android:icon="@drawable/ic_ime_switcher_dark"
- android:label="@string/subtype_serbian_latin"
- android:subtypeId="0xXXXXXXXX"
- android:imeSubtypeLocale="sr-Latn"
- android:imeSubtypeMode="keyboard"
- android:imeSubtypeExtraValue="KeyboardLayoutSet=qwerty,AsciiCapable,EmojiCapable"
+ android:imeSubtypeExtraValue="KeyboardLayoutSet=serbian_qwertz,AsciiCapable,EmojiCapable"
android:isAsciiCapable="true"
/>
- -->
<subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_generic"
android:subtypeId="0x48b4ff43"
diff --git a/java/res/xml/rowkeys_serbian_qwertz1.xml b/java/res/xml/rowkeys_serbian_qwertz1.xml
new file mode 100644
index 0000000..1615701
--- /dev/null
+++ b/java/res/xml/rowkeys_serbian_qwertz1.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2014, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<merge xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" >
+ <include latin:keyboardLayout="@xml/rowkeys_qwertz1" />
+ <!-- U+0161: "š" LATIN SMALL LETTER S WITH CARON -->
+ <Key latin:keySpec="š" />
+</merge>
\ No newline at end of file
diff --git a/java/res/xml/rowkeys_serbian_qwertz2.xml b/java/res/xml/rowkeys_serbian_qwertz2.xml
new file mode 100644
index 0000000..83ec92d
--- /dev/null
+++ b/java/res/xml/rowkeys_serbian_qwertz2.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2014, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<merge xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" >
+ <include latin:keyboardLayout="@xml/rowkeys_qwerty2" />
+ <!-- U+010D: "č" LATIN SMALL LETTER C WITH CARON -->
+ <Key latin:keySpec="č" />
+ <!-- U+0107: "ć" LATIN SMALL LETTER C WITH ACUTE -->
+ <Key latin:keySpec="ć" />
+</merge>
diff --git a/java/res/xml/rowkeys_serbian_qwertz3.xml b/java/res/xml/rowkeys_serbian_qwertz3.xml
new file mode 100644
index 0000000..30ba7af
--- /dev/null
+++ b/java/res/xml/rowkeys_serbian_qwertz3.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2014, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<merge xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" >
+ <include latin:keyboardLayout="@xml/rowkeys_qwertz3" />
+ <!-- U+0111: "đ" LATIN SMALL LETTER D WITH STROKE -->
+ <Key latin:keySpec="đ" />
+ <!-- U+017E: "ž" LATIN SMALL LETTER Z WITH CARON -->
+ <Key latin:keySpec="ž" />
+</merge>
diff --git a/java/res/xml/rows_serbian_qwertz.xml b/java/res/xml/rows_serbian_qwertz.xml
new file mode 100644
index 0000000..4be2abf
--- /dev/null
+++ b/java/res/xml/rows_serbian_qwertz.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2014, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<merge xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" >
+ <include latin:keyboardLayout="@xml/key_styles_common" />
+ <Row latin:keyWidth="9.091%p" >
+ <include latin:keyboardLayout="@xml/rowkeys_serbian_qwertz1" />
+ </Row>
+ <Row latin:keyWidth="9.091%p" >
+ <include latin:keyboardLayout="@xml/rowkeys_serbian_qwertz2" />
+ </Row>
+ <Row latin:keyWidth="8.711%p" >
+ <Key
+ latin:keyStyle="shiftKeyStyle"
+ latin:keyWidth="10.8%p" />
+ <include latin:keyboardLayout="@xml/rowkeys_serbian_qwertz3" />
+ <Key
+ latin:keyStyle="deleteKeyStyle"
+ latin:keyWidth="fillRight" />
+ </Row>
+ <include latin:keyboardLayout="@xml/row_qwerty4" />
+</merge>
\ No newline at end of file