Add Bengali keyboard layout

This is a preliminary keyboard layout.

Bug: 10028755
Change-Id: I365fb8e942a60d4b690a4af95fcd35bf73fffbe4
Tadashi G. Takaoka 2014-04-11 17:52:54 +09:00
parent 0100a49bdd
commit 0205fb220d
14 changed files with 967 additions and 196 deletions

View File

@ -0,0 +1,54 @@
<?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_bengali1" />
<Key
latin:keyStyle="deleteKeyStyle"
latin:keyWidth="fillRight" />
</Row>
<Row
latin:keyWidth="8.182%p"
>
<include
latin:keyboardLayout="@xml/rowkeys_bengali2" />
<Key
latin:keyStyle="enterKeyStyle"
latin:keyWidth="fillRight" />
</Row>
<Row
latin:keyWidth="8.182%p"
>
<include
latin:keyboardLayout="@xml/rowkeys_bengali3" />
<include
latin:keyboardLayout="@xml/keys_exclamation_question" />
</Row>
<include
latin:keyboardLayout="@xml/row_qwerty4" />
</merge>

View File

@ -0,0 +1,26 @@
<?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_bengali" />
</Keyboard>

View File

@ -92,28 +92,17 @@
<include
latin:keyboardLayout="@xml/key_styles_currency_euro" />
</case>
<!-- fa: Persian (Rial and Afgahni)
hi: Hindi (Indian Rupee)
iw: Hebrew (New Sheqel)
lo: Lao (Kip)
mn: Mongolian (Tugrik)
ne: Nepali (Nepalese Rupee)
th: Thai (Baht)
uk: Ukrainian (Hryvnia)
vi: Vietnamese (Dong) -->
<!-- TODO: The currency sign of Turkish Lira was created in 2012 and assigned U+20BA for
its unicode, although there is no font glyph for it as of November 2012. -->
<!-- TODO: The currency sign of Armenian Dram was created in 2012 and assigned U+058F for
its unicode, although there is no font glyph for it as of September 2013. -->
<!-- IN: India (Rupee) -->
<case
latin:languageCode="fa|hi|iw|lo|mn|ne|th|uk|vi"
latin:countryCode="IN"
>
<!-- U+00A3: "£" POUND SIGN
<!-- U+20B9: "₹" INDIAN RUPEE SIGN
U+00A3: "£" POUND SIGN
U+20AC: "€" EURO SIGN
U+00A2: "¢" CENT SIGN -->
<key-style
latin:styleName="currencyKeyStyle"
latin:keySpec="!text/keyspec_currency"
latin:keySpec="&#x20B9;"
latin:moreKeys="!text/morekeys_currency" />
<key-style
latin:styleName="moreCurrency1KeyStyle"
@ -129,17 +118,29 @@
latin:styleName="moreCurrency4KeyStyle"
latin:keySpec="&#x00A2;" />
</case>
<!-- IN: India (Rupee) -->
<!-- bn: Bengali (Bangladesh Taka)
fa: Persian (Rial and Afgahni)
hi: Hindi (Indian Rupee)
iw: Hebrew (New Sheqel)
lo: Lao (Kip)
mn: Mongolian (Tugrik)
ne: Nepali (Nepalese Rupee)
th: Thai (Baht)
uk: Ukrainian (Hryvnia)
vi: Vietnamese (Dong) -->
<!-- TODO: The currency sign of Turkish Lira was created in 2012 and assigned U+20BA for
its unicode, although there is no font glyph for it as of November 2012. -->
<!-- TODO: The currency sign of Armenian Dram was created in 2012 and assigned U+058F for
its unicode, although there is no font glyph for it as of September 2013. -->
<case
latin:countryCode="IN"
latin:languageCode="bn|fa|hi|iw|lo|mn|ne|th|uk|vi"
>
<!-- U+20B9: "₹" INDIAN RUPEE SIGN
U+00A3: "£" POUND SIGN
<!-- U+00A3: "£" POUND SIGN
U+20AC: "€" EURO SIGN
U+00A2: "¢" CENT SIGN -->
<key-style
latin:styleName="currencyKeyStyle"
latin:keySpec="&#x20B9;"
latin:keySpec="!text/keyspec_currency"
latin:moreKeys="!text/morekeys_currency" />
<key-style
latin:styleName="moreCurrency1KeyStyle"

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_bengali"
latin:enableProximityCharsCorrection="true" />
<Element
latin:elementName="symbols"
latin:elementKeyboard="@xml/kbd_symbols" />
<Element
latin:elementName="symbolsShifted"
latin:elementKeyboard="@xml/kbd_symbols_shift" />
<Element
latin:elementName="phone"
latin:elementKeyboard="@xml/kbd_phone" />
<Element
latin:elementName="phoneSymbols"
latin:elementKeyboard="@xml/kbd_phone_symbols" />
<Element
latin:elementName="number"
latin:elementKeyboard="@xml/kbd_number" />
</KeyboardLayoutSet>

View File

@ -28,6 +28,7 @@
be_BY: Belarusian (Belarus)/east_slavic
bg: Bulgarian/bulgarian
bg: Bulgarian/bulgarian_bds
(bn_IN: Bengali (India)/bengali) # This is a preliminary keyboard layout.
ca: Catalan/spanish
cs: Czech/qwertz
da: Danish/nordic
@ -171,6 +172,16 @@
android:imeSubtypeExtraValue="KeyboardLayoutSet=bulgarian_bds,EmojiCapable"
android:isAsciiCapable="false"
/>
<!-- TODO: This bengali 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="0xbff5986c"
android:imeSubtypeLocale="bn_IN"
android:imeSubtypeMode="keyboard"
android:imeSubtypeExtraValue="KeyboardLayoutSet=bengali,EmojiCapable"
android:isAsciiCapable="false"
/>
<subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_generic"
android:subtypeId="0xd2e520d5"

View File

@ -0,0 +1,109 @@
<?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"
>
<!-- U+0994: "ঔ" BENGALI LETTER AU
U+09E7: "১" BENGALI DIGIT ONE -->
<Key
latin:keySpec="&#x0994;"
latin:keyHintLabel="&#x09E7;"
latin:additionalMoreKeys="&#x09E7;,1"
latin:keyLabelFlags="fontNormal" />
<!-- U+0990: "ঐ" BENGALI LETTER AI
U+09E8: "২" BENGALI DIGIT TWO -->
<Key
latin:keySpec="&#x0990;"
latin:keyHintLabel="&#x09E8;"
latin:additionalMoreKeys="&#x09E8;,2"
latin:keyLabelFlags="fontNormal" />
<!-- U+0986: "আ" BENGALI LETTER AA
U+09E9: "৩" BENGALI DIGIT THREE -->
<Key
latin:keySpec="&#x0986;"
latin:keyHintLabel="&#x09E9;"
latin:additionalMoreKeys="&#x09E9;,3"
latin:keyLabelFlags="fontNormal" />
<!-- U+0988: "ঈ" BENGALI LETTER II
U+09EA: "" BENGALI DIGIT FOUR -->
<Key
latin:keySpec="&#x0988;"
latin:keyHintLabel="&#x09EA;"
latin:additionalMoreKeys="&#x09EA;,4"
latin:keyLabelFlags="fontNormal" />
<!-- U+098A: "ঊ" BENGALI LETTER UU
U+09EB: "৫" BENGALI DIGIT FIVE -->
<Key
latin:keySpec="&#x098A;"
latin:keyHintLabel="&#x09EB;"
latin:additionalMoreKeys="&#x09EB;,5"
latin:keyLabelFlags="fontNormal" />
<!-- U+09AC: "ব" BENGALI LETTER BA
U+09AD: "ভ" BENGALI LETTER BHA
U+09EC: "৬" BENGALI DIGIT SIX -->
<Key
latin:keySpec="&#x09AC;"
latin:moreKeys="&#x09AD;,%"
latin:keyHintLabel="&#x09EC;"
latin:additionalMoreKeys="&#x09EC;,6"
latin:keyLabelFlags="fontNormal" />
<!-- U+09B9: "হ" BENGALI LETTER HA
U+09ED: "" BENGALI DIGIT SEVEN -->
<Key
latin:keySpec="&#x09B9;"
latin:keyHintLabel="&#x09ED;"
latin:additionalMoreKeys="&#x09ED;,7"
latin:keyLabelFlags="fontNormal" />
<!-- U+0997: "গ" BENGALI LETTER GA
U+0998: "ঘ" BENGALI LETTER GHA
U+09EE: "৮" BENGALI DIGIT EIGHT -->
<Key
latin:keySpec="&#x0997;"
latin:moreKeys="&#x0998;,%"
latin:keyHintLabel="&#x09EE;"
latin:additionalMoreKeys="&#x09EE;,8"
latin:keyLabelFlags="fontNormal" />
<!-- U+09A6: "দ" BENGALI LETTER DA
U+09A7: "ধ" BENGALI LETTER DHA
U+09EF: "৯" BENGALI DIGIT NINE -->
<Key
latin:keySpec="&#x09A6;"
latin:moreKeys="&#x09A7;,%"
latin:keyHintLabel="&#x09EF;"
latin:additionalMoreKeys="&#x09EF;,9"
latin:keyLabelFlags="fontNormal" />
<!-- U+099C: "জ" BENGALI LETTER JA
U+099D: "ঝ" BENGALI LETTER JHA
U+099C/U+09CD/U+099E: "জ্ঞ" BENGALI LETTER JA/BENGALI SIGN VIRAMA/BENGALI LETTER NYA
U+09E6: "" BENGALI DIGIT ZERO -->
<Key
latin:keySpec="&#x099C;"
latin:moreKeys="&#x099D;,&#x099C;&#x09CD;&#x099E;,%"
latin:keyHintLabel="&#x09E6;"
latin:additionalMoreKeys="&#x09E6;,0"
latin:keyLabelFlags="fontNormal" />
<!-- U+09A1: "ড" BENGALI LETTER DDA
U+09A1/U+09BC: "ড়" BENGALI LETTER DDA/BENGALI SIGN NUKTA -->
<Key
latin:keySpec="&#x09A1;"
latin:moreKeys="&#x09A1;&#x09BC;"
latin:keyLabelFlags="fontNormal" />
</merge>

View File

@ -0,0 +1,94 @@
<?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"
>
<!-- U+0993: "ও" BENGALI LETTER O
U+09CB: "ো" BENGALI VOWEL SIGN O -->
<Key
latin:keySpec="&#x0993;"
latin:moreKeys="&#x09CB;"
latin:keyLabelFlags="fontNormal" />
<!-- U+098F: "এ" BENGALI LETTER E
U+09C7: "ে" BENGALI VOWEL SIGN E -->
<Key
latin:keySpec="&#x098F;"
latin:moreKeys="&#x09C7;"
latin:keyLabelFlags="fontNormal" />
<!-- U+0985: "অ" BENGALI LETTER A
U+09CD: "্" BENGALI SIGN VIRAMA -->
<Key
latin:keySpec="&#x0985;"
latin:moreKeys="&#x09CD;"
latin:keyLabelFlags="fontNormal" />
<!-- U+0987: "ই" BENGALI LETTER I
U+09BF: "ি" BENGALI VOWEL SIGN I -->
<Key
latin:keySpec="&#x0987;"
latin:moreKeys="&#x09BF;"
latin:keyLabelFlags="fontNormal" />
<!-- U+0989: "উ" BENGALI LETTER U
U+09C1: "ু" BENGALI VOWEL SIGN U -->
<Key
latin:keySpec="&#x0989;"
latin:moreKeys="&#x09C1;"
latin:keyLabelFlags="fontNormal" />
<!-- U+09AA: "প" BENGALI LETTER PA
U+09AB: "ফ" BENGALI LETTER PHA -->
<Key
latin:keySpec="&#x09AA;"
latin:moreKeys="&#x09AB;"
latin:keyLabelFlags="fontNormal" />
<!-- U+09B0: "র" BENGALI LETTER RA
U+09C3: "ৃ" BENGALI VOWEL SIGN VOCALIC R
U+098B: "ঋ" BENGALI LETTER VOCALIC R
U+09A4/U+09CD/U+09B0: "ত্র" BENGALI LETTER TA/BENGALI SIGN VIRAMA/BENGALI LETTER RA -->
<Key
latin:keySpec="&#x09B0;"
latin:moreKeys="&#x09C3;,&#x098B;,&#x09A4;&#x09CD;&#x09B0;"
latin:keyLabelFlags="fontNormal" />
<!-- U+0995: "ক" BENGALI LETTER KA
U+0996: "খ" BENGALI LETTER KHA -->
<Key
latin:keySpec="&#x0995;"
latin:moreKeys="&#x0996;"
latin:keyLabelFlags="fontNormal" />
<!-- U+09A4: "ত" BENGALI LETTER TA
U+09CE: "ৎ" BENGALI LETTER KHANDA TA
U+09A5: "থ" BENGALI LETTER THA
U+09A4/U+09CD/U+09A4: "ত্ত" BENGALI LETTER TA/BENGALI SIGN VIRAMA/BENGALI LETTER TA -->
<Key
latin:keySpec="&#x09A4;"
latin:moreKeys="&#x09CE;,&#x09A5;,&#x09A4;&#x09CD;&#x09A4;"
latin:keyLabelFlags="fontNormal" />
<!-- U+099A: "চ" BENGALI LETTER CA
U+099B: "ছ" BENGALI LETTER CHA -->
<Key
latin:keySpec="&#x099A;"
latin:moreKeys="&#x099B;"
latin:keyLabelFlags="fontNormal" />
<!-- U+099F: "ট" BENGALI LETTER TTA
U+09A0: "ঠ" BENGALI LETTER TTHA -->
<Key
latin:keySpec="&#x099F;"
latin:moreKeys="&#x09A0;"
latin:keyLabelFlags="fontNormal" />
</merge>

View File

@ -0,0 +1,82 @@
<?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"
>
<!-- U+0981: "ঁ" BENGALI SIGN CANDRABINDU
U+0983: "ঃ" BENGALI SIGN VISARGA
U+0982: "ং" BENGALI SIGN ANUSVARA -->
<Key
latin:keySpec="&#x0981;"
latin:moreKeys="&#x0983;,&#x0982;"
latin:keyLabelFlags="fontNormal" />
<!-- U+09A2: "ঢ" BENGALI LETTER DDHA
U+09A2/U+09BC: "ঢ়" BENGALI LETTER DDHA/BENGALI SIGN NUKTA -->
<Key
latin:keySpec="&#x09A2;"
latin:moreKeys="&#x09A2;&#x09BC;"
latin:keyLabelFlags="fontNormal" />
<!-- U+09AE: "ম" BENGALI LETTER MA -->
<Key
latin:keySpec="&#x09AE;"
latin:keyLabelFlags="fontNormal" />
<!-- U+09A8: "ন" BENGALI LETTER NA
U+09A3: "ণ" BENGALI LETTER NNA -->
<Key
latin:keySpec="&#x09A8;"
latin:moreKeys="&#x09A3;"
latin:keyLabelFlags="fontNormal" />
<!-- U+099E: "ঞ" BENGALI LETTER NYA
U+0999: "ঙ" BENGALI LETTER NGA
U+099E/U+09CD/U+099C: "ঞ্জ" BENGALI LETTER NYA/BENGALI SIGN VIRAMA/BENGALI LETTER JA -->
<Key
latin:keySpec="&#x099E;"
latin:moreKeys="&#x0999;,&#x099E;&#x09CD;&#x099C;"
latin:keyLabelFlags="fontNormal" />
<!-- U+09B2: "ল" BENGALI LETTER LA -->
<Key
latin:keySpec="&#x09B2;"
latin:keyLabelFlags="fontNormal" />
<!-- U+09B7: "ষ" BENGALI LETTER SSA
U+0995/U+09CD/U+09B7: "ক্ষ" BENGALI LETTER KA/BENGALI SIGN VIRAMA/BENGALI LETTER SSA -->
<Key
latin:keySpec="&#x09B7;"
latin:moreKeys="&#x0995;&#x09CD;&#x09B7;"
latin:keyLabelFlags="fontNormal" />
<!-- U+09B8: "স" BENGALI LETTER SA
U+09B6: "শ" BENGALI LETTER SHA -->
<Key
latin:keySpec="&#x09B8;"
latin:moreKeys="&#x09B6;"
latin:keyLabelFlags="fontNormal" />
<!-- U+09DF: "য়" BENGALI LETTER YYA
U+09AF: "য" BENGALI LETTER YA -->
<Key
latin:keySpec="&#x09DF;"
latin:moreKeys="&#x09AF;"
latin:keyLabelFlags="fontNormal" />
<!-- U+0964: "।" DEVANAGARI DANDA
U+0965: "॥" DEVANAGARI DOUBLE DANDA -->
<Key
latin:keySpec="&#x0964;"
latin:moreKeys="&#x0965;"
latin:keyLabelFlags="fontNormal" />
</merge>

View File

@ -0,0 +1,49 @@
<?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_bengali1" />
</Row>
<Row
latin:keyWidth="9.091%p"
>
<include
latin:keyboardLayout="@xml/rowkeys_bengali2" />
</Row>
<Row
latin:keyWidth="9.091%p"
>
<include
latin:keyboardLayout="@xml/rowkeys_bengali3" />
<Key
latin:keyStyle="deleteKeyStyle"
latin:keyWidth="fillRight" />
</Row>
<include
latin:keyboardLayout="@xml/row_qwerty4" />
</merge>

View File

@ -25,7 +25,7 @@ import java.util.ArrayList;
@SmallTest
public class KeyboardLayoutSetSubtypesCountTests extends KeyboardLayoutSetTestsBase {
private static final int NUMBER_OF_SUBTYPES = 72;
private static final int NUMBER_OF_SUBTYPES = 73;
private static final int NUMBER_OF_ASCII_CAPABLE_SUBTYPES = 45;
private static final int NUMBER_OF_PREDEFINED_ADDITIONAL_SUBTYPES = 2;

View File

@ -0,0 +1,187 @@
/*
* 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;
import com.android.inputmethod.latin.Constants;
import java.util.Locale;
/**
* The Bengali keyboard.
*/
public final class Bengali extends LayoutBase {
private static final String LAYOUT_NAME = "bengali";
public Bengali(final LayoutCustomizer customizer) {
super(customizer, Symbols.class, SymbolsShifted.class);
}
@Override
public String getName() { return LAYOUT_NAME; }
public static class BengaliCustomizer extends LayoutCustomizer {
public BengaliCustomizer(final Locale locale) { super(locale); }
@Override
public ExpectedKey getAlphabetKey() { return BENGALI_ALPHABET_KEY; }
@Override
public ExpectedKey[] getOtherCurrencyKeys() {
return SymbolsShifted.CURRENCIES_OTHER_GENERIC;
}
@Override
public ExpectedKey[] getLeftShiftKeys(final boolean isPhone) { return EMPTY_KEYS; }
@Override
public ExpectedKey[] getRightShiftKeys(final boolean isPhone) {
return isPhone ? EMPTY_KEYS : EXCLAMATION_AND_QUESTION_MARKS;
}
// U+0995: "क" BENGALI LETTER KA
// U+0996: "ख" BENGALI LETTER KHA
// U+0997: "ग" BENGALI LETTER GA
private static final ExpectedKey BENGALI_ALPHABET_KEY = key(
"\u0995\u0996\u0997", Constants.CODE_SWITCH_ALPHA_SYMBOL);
}
@Override
ExpectedKey[][] getCommonAlphabetLayout(boolean isPhone) { return ALPHABET_COMMON; }
@Override
ExpectedKey[][] getCommonAlphabetShiftLayout(boolean isPhone, final int elementId) {
return null;
}
private static final ExpectedKey[][] ALPHABET_COMMON = new ExpectedKeyboardBuilder()
.setKeysOfRow(1,
// U+0994: "ঔ" BENGALI LETTER AU
// U+09E7: "১" BENGALI DIGIT ONE
key("\u0994", joinMoreKeys("\u09E7", "1")),
// U+0990: "ঐ" BENGALI LETTER AI
// U+09E8: "২" BENGALI DIGIT TWO
key("\u0990", joinMoreKeys("\u09E8", "2")),
// U+0986: "আ" BENGALI LETTER AA
// U+09E9: "৩" BENGALI DIGIT THREE
key("\u0986", joinMoreKeys("\u09E9", "3")),
// U+0988: "ঈ" BENGALI LETTER II
// U+09EA: "" BENGALI DIGIT FOUR
key("\u0988", joinMoreKeys("\u09EA", "4")),
// U+098A: "ঊ" BENGALI LETTER UU
// U+09EB: "৫" BENGALI DIGIT FIVE
key("\u098A", joinMoreKeys("\u09EB", "5")),
// U+09AC: "ব" BENGALI LETTER BA
// U+09AD: "ভ" BENGALI LETTER BHA
// U+09EC: "৬" BENGALI DIGIT SIX
key("\u09AC", joinMoreKeys("\u09AD", "\u09EC", "6")),
// U+09B9: "হ" BENGALI LETTER HA
// U+09ED: "" BENGALI DIGIT SEVEN
key("\u09B9", joinMoreKeys("\u09ED", "7")),
// U+0997: "গ" BENGALI LETTER GA
// U+0998: "ঘ" BENGALI LETTER GHA
// U+09EE: "৮" BENGALI DIGIT EIGHT
key("\u0997", joinMoreKeys("\u0998", "\u09EE", "8")),
// U+09A6: "দ" BENGALI LETTER DA
// U+09A7: "ধ" BENGALI LETTER DHA
// U+09EF: "৯" BENGALI DIGIT NINE
key("\u09A6", joinMoreKeys("\u09A7", "\u09EF", "9")),
// U+099C: "জ" BENGALI LETTER JA
// U+099D: "ঝ" BENGALI LETTER JHA
// U+099C/U+09CD/U+099E:
// "জ্ঞ" BENGALI LETTER JA/BENGALI SIGN VIRAMA/BENGALI LETTER NYA
// U+09E6: "" BENGALI DIGIT ZERO
key("\u099C", joinMoreKeys("\u099D", "\u099C\u09CD\u099E", "\u09E6", "0")),
// U+09A1: "ড" BENGALI LETTER DDA
// U+09A1/U+09BC: "ড়" BENGALI LETTER DDA/BENGALI SIGN NUKTA
key("\u09A1", moreKey("\u09A1\u09BC")))
.setKeysOfRow(2,
// U+0993: "ও" BENGALI LETTER O
// U+09CB: "ো" BENGALI VOWEL SIGN O
key("\u0993", moreKey("\u09CB")),
// U+098F: "এ" BENGALI LETTER E
// U+09C7: "ে" BENGALI VOWEL SIGN E
key("\u098F", moreKey("\u09C7")),
// U+0985: "অ" BENGALI LETTER A
// U+09CD: "্" BENGALI SIGN VIRAMA
key("\u0985", moreKey("\u09CD")),
// U+0987: "ই" BENGALI LETTER I
// U+09BF: "ি" BENGALI VOWEL SIGN I
key("\u0987", moreKey("\u09BF")),
// U+0989: "উ" BENGALI LETTER U
// U+09C1: "ু" BENGALI VOWEL SIGN U
key("\u0989", moreKey("\u09C1")),
// U+09AA: "প" BENGALI LETTER PA
// U+09AB: "ফ" BENGALI LETTER PHA
key("\u09AA", moreKey("\u09AB")),
// U+09B0: "র" BENGALI LETTER RA
// U+09C3: "ৃ" BENGALI VOWEL SIGN VOCALIC R
// U+098B: "ঋ" BENGALI LETTER VOCALIC R
// U+09A4/U+09CD/U+09B0:
// "ত্র" BENGALI LETTER TA/BENGALI SIGN VIRAMA/BENGALI LETTER RA
key("\u09B0", joinMoreKeys("\u09C3", "\u098B", "\u09A4\u09CD\u09B0")),
// U+0995: "ক" BENGALI LETTER KA
// U+0996: "খ" BENGALI LETTER KHA
key("\u0995", moreKey("\u0996")),
// U+09A4: "ত" BENGALI LETTER TA
// U+09CE: "ৎ" BENGALI LETTER KHANDA TA
// U+09A5: "থ" BENGALI LETTER THA
// U+09A4/U+09CD/U+09A4:
// "ত্ত" BENGALI LETTER TA/BENGALI SIGN VIRAMA/BENGALI LETTER TA
key("\u09A4", joinMoreKeys("\u09CE", "\u09A5", "\u09A4\u09CD\u09A4")),
// U+099A: "চ" BENGALI LETTER CA
// U+099B: "ছ" BENGALI LETTER CHA
key("\u099A", moreKey("\u099B")),
// U+099F: "ট" BENGALI LETTER TTA
// U+09A0: "ঠ" BENGALI LETTER TTHA
key("\u099F", moreKey("\u09A0")))
.setKeysOfRow(3,
// U+0981: "ঁ" BENGALI SIGN CANDRABINDU
// U+0983: "ঃ" BENGALI SIGN VISARGA
// U+0982: "ং" BENGALI SIGN ANUSVARA
key("\u0981", joinMoreKeys("\u0983", "\u0982")),
// U+09A2: "ঢ" BENGALI LETTER DDHA
// U+09A2/U+09BC: "ঢ়" BENGALI LETTER DDHA/BENGALI SIGN NUKTA
key("\u09A2", moreKey("\u09A2\u09BC")),
// U+09AE: "ম" BENGALI LETTER MA
"\u09AE",
// U+09A8: "ন" BENGALI LETTER NA
// U+09A3: "ণ" BENGALI LETTER NNA
key("\u09A8", moreKey("\u09A3")),
// U+099E: "ঞ" BENGALI LETTER NYA
// U+0999: "ঙ" BENGALI LETTER NGA
// U+099E/U+09CD/U+099C:
// "ঞ্জ" BENGALI LETTER NYA/BENGALI SIGN VIRAMA/BENGALI LETTER JA
key("\u099E", joinMoreKeys("\u0999", "\u099E\u09CD\u099C")),
// U+09B2: "ল" BENGALI LETTER LA
"\u09B2",
// U+09B7: "ষ" BENGALI LETTER SSA
// U+0995/U+09CD/U+09B7:
// "ক্ষ" BENGALI LETTER KA/BENGALI SIGN VIRAMA/BENGALI LETTER SSA
key("\u09B7", moreKey("\u0995\u09CD\u09B7")),
// U+09B8: "স" BENGALI LETTER SA
// U+09B6: "শ" BENGALI LETTER SHA
key("\u09B8", moreKey("\u09B6")),
// U+09DF: "য়" BENGALI LETTER YYA
// U+09AF: "য" BENGALI LETTER YA
key("\u09DF", moreKey("\u09AF")),
// U+0964: "।" DEVANAGARI DANDA
// U+0965: "॥" DEVANAGARI DOUBLE DANDA
key("\u0964", moreKey("\u0965")))
.build();
}

View File

@ -0,0 +1,50 @@
/*
* 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.Bengali;
import com.android.inputmethod.keyboard.layout.Bengali.BengaliCustomizer;
import com.android.inputmethod.keyboard.layout.LayoutBase;
import com.android.inputmethod.keyboard.layout.Symbols;
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
import java.util.Locale;
/**
* bn_IN: Bengali (India)/bengali
*/
@SmallTest
public final class TestsBengaliIN extends LayoutTestsBase {
private static final Locale LOCALE = new Locale("bn", "IN");
private static final LayoutBase LAYOUT = new Bengali(new BengaliINCustomzier(LOCALE));
@Override
LayoutBase getLayout() { return LAYOUT; }
private static class BengaliINCustomzier extends BengaliCustomizer {
public BengaliINCustomzier(final Locale locale) { super(locale); }
@Override
public ExpectedKey getCurrencyKey() { return CURRENCY_RUPEE; }
// U+20B9: "₹" INDIAN RUPEE SIGN
private static final ExpectedKey CURRENCY_RUPEE = key("\u20B9",
Symbols.CURRENCY_GENERIC_MORE_KEYS);
}
}

View File

@ -0,0 +1,28 @@
<?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">
<!-- Label for "switch to alphabetic" key.
U+0995: "क" BENGALI LETTER KA
U+0996: "ख" BENGALI LETTER KHA
U+0997: "ग" BENGALI LETTER GA -->
<string name="keylabel_to_alpha">&#x0995;&#x0996;&#x0997;</string>
<!-- U+09F3: "৳" BENGALI RUPEE SIGN -->
<string name="keyspec_currency">&#x09F3;</string>
</resources>