Add Uzbek keyboard

Bug: 13222403
Change-Id: I9a4cf447a8ab0c26c4dc7f7794c57390024660cc
main
Tadashi G. Takaoka 2014-09-26 16:00:47 +09:00
parent 79d992ccba
commit 31c16d41bc
15 changed files with 788 additions and 241 deletions

View File

@ -0,0 +1,48 @@
<?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="8.182%p" >
<include latin:keyboardLayout="@xml/rowkeys_uzbek1" />
<Key
latin:keyStyle="deleteKeyStyle"
latin:keyWidth="fillRight" />
</Row>
<Row latin:keyWidth="8.182%p" >
<include latin:keyboardLayout="@xml/rowkeys_uzbek2" />
<Key
latin:keyStyle="enterKeyStyle"
latin:keyWidth="fillRight" />
</Row>
<Row latin:keyWidth="8.182%p" >
<Key
latin:keyStyle="shiftKeyStyle"
latin:keyWidth="10.0%p" />
<Spacer latin:keyWidth="3.181%p" />
<include latin:keyboardLayout="@xml/rowkeys_qwerty3" />
<include latin:keyboardLayout="@xml/keys_exclamation_question" />
<Key
latin:keyStyle="shiftKeyStyle"
latin:keyWidth="fillRight"
latin:keyXPos="-10.0%p" />
</Row>
<include latin:keyboardLayout="@xml/row_qwerty4" />
</merge>

View File

@ -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_uzbek" />
</Keyboard>

View File

@ -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:elementName="alphabet"
latin:elementKeyboard="@xml/kbd_uzbek"
latin:enableProximityCharsCorrection="true"
latin:allowRedundantMoreKeys="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>

View File

@ -101,6 +101,7 @@
tl: Tagalog/spanish tl: Tagalog/spanish
tr: Turkish/qwerty tr: Turkish/qwerty
uk: Ukrainian/east_slavic uk: Ukrainian/east_slavic
(uz_UZ: Uzbek (Uzbekistan)/uzbek) # This is a preliminary keyboard layout.
vi: Vietnamese/qwerty vi: Vietnamese/qwerty
zu: Zulu/qwerty zu: Zulu/qwerty
zz: QWERTY/qwerty zz: QWERTY/qwerty
@ -672,6 +673,8 @@
android:imeSubtypeExtraValue="SupportTouchPositionCorrection,EmojiCapable" android:imeSubtypeExtraValue="SupportTouchPositionCorrection,EmojiCapable"
android:isAsciiCapable="false" android:isAsciiCapable="false"
/> />
<!-- TODO: This Serbian Latin keyboard is a preliminary layout.
This isn't based on the final specification. -->
<subtype android:icon="@drawable/ic_ime_switcher_dark" <subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_sr_ZZ" android:label="@string/subtype_sr_ZZ"
android:subtypeId="0xf4a5569c" android:subtypeId="0xf4a5569c"
@ -763,6 +766,16 @@
android:imeSubtypeExtraValue="KeyboardLayoutSet=east_slavic,EmojiCapable" android:imeSubtypeExtraValue="KeyboardLayoutSet=east_slavic,EmojiCapable"
android:isAsciiCapable="false" android:isAsciiCapable="false"
/> />
<!-- TODO: This Uzbek keyboard is a preliminary layout.
This isn't based on the final specification. -->
<subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_generic"
android:subtypeId="0xad5cf7f6"
android:imeSubtypeLocale="uz_UZ"
android:imeSubtypeMode="keyboard"
android:imeSubtypeExtraValue="KeyboardLayoutSet=uzbek,AsciiCapable,EmojiCapable"
android:isAsciiCapable="true"
/>
<subtype android:icon="@drawable/ic_ime_switcher_dark" <subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_generic" android:label="@string/subtype_generic"
android:subtypeId="0x93972eee" android:subtypeId="0x93972eee"

View File

@ -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_qwerty1" />
<!-- U+006F/U+02BB: "oʻ" LATIN SMALL LETTER O/MODIFIER LETTER TURNED COMMA -->
<Key
latin:keySpec="o&#x02BB;"
latin:keyLabelFlags="followKeyLetterRatio" />
</merge>

View File

@ -0,0 +1,29 @@
<?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+0067/U+02BB: "gʻ" LATIN SMALL LETTER G/MODIFIER LETTER TURNED COMMA -->
<Key
latin:keySpec="g&#x02BB;"
latin:keyLabelFlags="followKeyLetterRatio" />
<!-- U+02BC: "ʼ" MODIFIER LETTER APOSTROPHE -->
<Key latin:keySpec="&#x02BC;" />
</merge>

View File

@ -0,0 +1,43 @@
<?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_uzbek1" />
</Row>
<Row latin:keyWidth="9.091%p" >
<include latin:keyboardLayout="@xml/rowkeys_uzbek2" />
</Row>
<Row latin:keyWidth="9.2%p" >
<Key
latin:keyStyle="shiftKeyStyle"
latin:keyWidth="15%p"
latin:visualInsetsRight="1%p" />
<Spacer latin:keyWidth="2.8%p" />
<include latin:keyboardLayout="@xml/rowkeys_qwerty3" />
<Key
latin:keyStyle="deleteKeyStyle"
latin:keyWidth="fillRight"
latin:keyXPos="-15%p"
latin:visualInsetsLeft="1%p" />
</Row>
<include latin:keyboardLayout="@xml/row_qwerty4" />
</merge>

View File

@ -25,8 +25,8 @@ import java.util.ArrayList;
@SmallTest @SmallTest
public class KeyboardLayoutSetSubtypesCountTests extends KeyboardLayoutSetTestsBase { public class KeyboardLayoutSetSubtypesCountTests extends KeyboardLayoutSetTestsBase {
private static final int NUMBER_OF_SUBTYPES = 82; private static final int NUMBER_OF_SUBTYPES = 83;
private static final int NUMBER_OF_ASCII_CAPABLE_SUBTYPES = 49; private static final int NUMBER_OF_ASCII_CAPABLE_SUBTYPES = 50;
private static final int NUMBER_OF_PREDEFINED_ADDITIONAL_SUBTYPES = 2; private static final int NUMBER_OF_PREDEFINED_ADDITIONAL_SUBTYPES = 2;
@Override @Override

View File

@ -0,0 +1,58 @@
/*
* Copyright (C) 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.
*/
package com.android.inputmethod.keyboard.layout;
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
/**
* The Uzbek alphabet keyboard.
*/
public final class Uzbek extends LayoutBase {
private static final String LAYOUT_NAME = "uzbek";
public Uzbek(final LayoutCustomizer customizer) {
super(customizer, Symbols.class, SymbolsShifted.class);
}
@Override
public String getName() { return LAYOUT_NAME; }
@Override
ExpectedKey[][] getCommonAlphabetLayout(final boolean isPhone) { return ALPHABET_COMMON; }
public static final String ROW1_11 = "ROW1_11";
public static final String ROW2_10 = "ROW2_10";
public static final String ROW2_11 = "ROW2_11";
private static final ExpectedKey[][] ALPHABET_COMMON = new ExpectedKeyboardBuilder()
.setKeysOfRow(1,
key("q", additionalMoreKey("1")),
key("w", additionalMoreKey("2")),
key("e", additionalMoreKey("3")),
key("r", additionalMoreKey("4")),
key("t", additionalMoreKey("5")),
key("y", additionalMoreKey("6")),
key("u", additionalMoreKey("7")),
key("i", additionalMoreKey("8")),
key("o", additionalMoreKey("9")),
key("p", additionalMoreKey("0")),
ROW1_11)
.setKeysOfRow(2, "a", "s", "d", "f", "g", "h", "j", "k", "l", ROW2_10, ROW2_11)
.setKeysOfRow(3, "z", "x", "c", "v", "b", "n", "m")
.build();
}

View File

@ -0,0 +1,36 @@
/*
* Copyright (C) 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.
*/
package com.android.inputmethod.keyboard.layout.tests;
import android.test.suitebuilder.annotation.SmallTest;
import com.android.inputmethod.keyboard.layout.LayoutBase;
import com.android.inputmethod.keyboard.layout.Uzbek;
import java.util.Locale;
/**
* uz_UZ: Uzbek (Uzbekistan)/uzbek
*/
@SmallTest
public final class TestsUzbek extends LayoutTestsBase {
private static final Locale LOCALE = new Locale("uz", "UZ");
private static final LayoutBase LAYOUT = new Uzbek(new UzbekCustomizer(LOCALE));
@Override
LayoutBase getLayout() { return LAYOUT; }
}

View File

@ -0,0 +1,48 @@
/*
* Copyright (C) 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.
*/
package com.android.inputmethod.keyboard.layout.tests;
import android.test.suitebuilder.annotation.SmallTest;
import com.android.inputmethod.keyboard.layout.LayoutBase;
import com.android.inputmethod.keyboard.layout.Qwerty;
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
import java.util.Locale;
/**
* uz_UZ: Uzbek (Uzbekistan)/qwerty
*/
@SmallTest
public final class TestsUzbekQwerty extends LayoutTestsBase {
private static final Locale LOCALE = new Locale("uz", "UZ");
private static final LayoutBase LAYOUT = new Qwerty(new UzbekQwertyCustomizer(LOCALE));
@Override
LayoutBase getLayout() { return LAYOUT; }
private static class UzbekQwertyCustomizer extends UzbekCustomizer {
public UzbekQwertyCustomizer(final Locale locale) {
super(locale);
}
@Override
protected void setUzbekKeys(final ExpectedKeyboardBuilder builder) {
// QWERTY layout doesn't have Uzebk keys.
}
}
}

View File

@ -0,0 +1,44 @@
/*
* Copyright (C) 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.
*/
package com.android.inputmethod.keyboard.layout.tests;
import com.android.inputmethod.keyboard.layout.Nordic;
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
import java.util.Locale;
class UzbekCustomizer extends TurkicCustomizer {
public UzbekCustomizer(final Locale locale) {
super(locale);
}
protected void setUzbekKeys(final ExpectedKeyboardBuilder builder) {
builder
// U+006F/U+02BB: "oʻ" LATIN SMALL LETTER O/MODIFIER LETTER TURNED COMMA
.replaceKeyOfLabel(Nordic.ROW1_11, "o\u02BB")
// U+0067/U+02BB: "gʻ" LATIN SMALL LETTER G/MODIFIER LETTER TURNED COMMA
.replaceKeyOfLabel(Nordic.ROW2_10, "g\u02BB")
// U+02BC: "ʼ" MODIFIER LETTER APOSTROPHE
.replaceKeyOfLabel(Nordic.ROW2_11, "\u02BC");
}
@Override
public ExpectedKeyboardBuilder setAccentedLetters(final ExpectedKeyboardBuilder builder) {
setUzbekKeys(builder);
return super.setAccentedLetters(builder);
}
}

View File

@ -18,6 +18,7 @@
*/ */
--> -->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- This is the same as Turkish -->
<!-- U+00E2: "â" LATIN SMALL LETTER A WITH CIRCUMFLEX <!-- U+00E2: "â" LATIN SMALL LETTER A WITH CIRCUMFLEX
U+00E4: "ä" LATIN SMALL LETTER A WITH DIAERESIS U+00E4: "ä" LATIN SMALL LETTER A WITH DIAERESIS
U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE --> U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE -->

View File

@ -0,0 +1,70 @@
<?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.
*/
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- This is the same as Turkish -->
<!-- U+00E2: "â" LATIN SMALL LETTER A WITH CIRCUMFLEX
U+00E4: "ä" LATIN SMALL LETTER A WITH DIAERESIS
U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE -->
<string name="morekeys_a">&#x00E2;,&#x00E4;,&#x00E1;</string>
<!-- U+0259: "ə" LATIN SMALL LETTER SCHWA
U+00E9: "é" LATIN SMALL LETTER E WITH ACUTE -->
<string name="morekeys_e">&#x0259;,&#x00E9;</string>
<!-- U+0131: "ı" LATIN SMALL LETTER DOTLESS I
U+00EE: "î" LATIN SMALL LETTER I WITH CIRCUMFLEX
U+00EF: "ï" LATIN SMALL LETTER I WITH DIAERESIS
U+00EC: "ì" LATIN SMALL LETTER I WITH GRAVE
U+00ED: "í" LATIN SMALL LETTER I WITH ACUTE
U+012F: "į" LATIN SMALL LETTER I WITH OGONEK
U+012B: "ī" LATIN SMALL LETTER I WITH MACRON -->
<string name="morekeys_i">&#x0131;,&#x00EE;,&#x00EF;,&#x00EC;,&#x00ED;,&#x012F;,&#x012B;</string>
<!-- U+00F6: "ö" LATIN SMALL LETTER O WITH DIAERESIS
U+00F4: "ô" LATIN SMALL LETTER O WITH CIRCUMFLEX
U+0153: "œ" LATIN SMALL LIGATURE OE
U+00F2: "ò" LATIN SMALL LETTER O WITH GRAVE
U+00F3: "ó" LATIN SMALL LETTER O WITH ACUTE
U+00F5: "õ" LATIN SMALL LETTER O WITH TILDE
U+00F8: "ø" LATIN SMALL LETTER O WITH STROKE
U+014D: "ō" LATIN SMALL LETTER O WITH MACRON -->
<string name="morekeys_o">&#x00F6;,&#x00F4;,&#x0153;,&#x00F2;,&#x00F3;,&#x00F5;,&#x00F8;,&#x014D;</string>
<!-- U+00FC: "ü" LATIN SMALL LETTER U WITH DIAERESIS
U+00FB: "û" LATIN SMALL LETTER U WITH CIRCUMFLEX
U+00F9: "ù" LATIN SMALL LETTER U WITH GRAVE
U+00FA: "ú" LATIN SMALL LETTER U WITH ACUTE
U+016B: "ū" LATIN SMALL LETTER U WITH MACRON -->
<string name="morekeys_u">&#x00FC;,&#x00FB;,&#x00F9;,&#x00FA;,&#x016B;</string>
<!-- U+015F: "ş" LATIN SMALL LETTER S WITH CEDILLA
U+00DF: "ß" LATIN SMALL LETTER SHARP S
U+015B: "ś" LATIN SMALL LETTER S WITH ACUTE
U+0161: "š" LATIN SMALL LETTER S WITH CARON -->
<string name="morekeys_s">&#x015F;,&#x00DF;,&#x015B;,&#x0161;</string>
<!-- U+011F: "ğ" LATIN SMALL LETTER G WITH BREVE -->
<string name="morekeys_g">&#x011F;</string>
<!-- U+0148: "ň" LATIN SMALL LETTER N WITH CARON
U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE -->
<string name="morekeys_n">&#x0148;,&#x00F1;</string>
<!-- U+00E7: "ç" LATIN SMALL LETTER C WITH CEDILLA
U+0107: "ć" LATIN SMALL LETTER C WITH ACUTE
U+010D: "č" LATIN SMALL LETTER C WITH CARON -->
<string name="morekeys_c">&#x00E7;,&#x0107;,&#x010D;</string>
<!-- U+00FD: "ý" LATIN SMALL LETTER Y WITH ACUTE -->
<string name="morekeys_y">&#x00FD;</string>
<!-- U+017E: "ž" LATIN SMALL LETTER Z WITH CARON -->
<string name="morekeys_z">&#x017E;</string>
</resources>