Add keyboard layout test for API 14 and 15

Bug: 13017434
Change-Id: Iaa995ba0b6ba4caabc7c77f084f376bebc5b766e
main
Tadashi G. Takaoka 2014-04-03 16:48:02 +09:00
parent de2b312c6d
commit b6ca5763aa
4 changed files with 172 additions and 42 deletions

View File

@ -0,0 +1,75 @@
/*
* 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 android.os.Build;
/**
* This class offers label strings of Devanagari letters that need the dotted circle to draw
* its glyph.
*/
class DevanagariLetterConstants {
private static final boolean NEEDS_DOTTED_CIRCLE =
Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN;
// U+25CC: "◌" DOTTED CIRCLE
private static final String DOTTED_CIRCLE = NEEDS_DOTTED_CIRCLE ? "\u25CC" : "";
// U+0901: "ँ" DEVANAGARI SIGN CANDRABINDU
static final String SIGN_CANDRABINDU = DOTTED_CIRCLE + "\u0901";
// U+0902: "ं" DEVANAGARI SIGN ANUSVARA
static final String SIGN_ANUSVARA = DOTTED_CIRCLE + "\u0902";
// U+0903: "" DEVANAGARI SIGN VISARGA
static final String SIGN_VISARGA = DOTTED_CIRCLE + "\u0903";
// U+093C: "़" DEVANAGARI SIGN NUKTA
static final String SIGN_NUKTA = DOTTED_CIRCLE + "\u093C";
// U+093D: "ऽ" DEVANAGARI SIGN AVAGRAHA
static final String SIGN_AVAGRAHA = DOTTED_CIRCLE + "\u093D";
// U+093E: "ा" DEVANAGARI VOWEL SIGN AA
static final String VOWEL_SIGN_AA = DOTTED_CIRCLE + "\u093E";
// U+093F: "ि" DEVANAGARI VOWEL SIGN I
static final String VOWEL_SIGN_I = DOTTED_CIRCLE + "\u093F";
// U+0940: "ी" DEVANAGARI VOWEL SIGN II
static final String VOWEL_SIGN_II = DOTTED_CIRCLE + "\u0940";
// U+0941: "ु" DEVANAGARI VOWEL SIGN U
static final String VOWEL_SIGN_U = DOTTED_CIRCLE + "\u0941";
// U+0942: "ू" DEVANAGARI VOWEL SIGN UU
static final String VOWEL_SIGN_UU = DOTTED_CIRCLE + "\u0942";
// U+0943: "ृ" DEVANAGARI VOWEL SIGN VOCALIC R
static final String VOWEL_SIGN_VOCALIC_R = DOTTED_CIRCLE + "\u0943";
// U+0944: "ॄ" DEVANAGARI VOWEL SIGN VOCALIC RR
static final String VOWEL_SIGN_VOCALIC_RR = DOTTED_CIRCLE + "\u0944";
// U+0945: "ॅ" DEVANAGARI VOWEL SIGN CANDRA E
static final String VOWEL_SIGN_CANDRA_E = DOTTED_CIRCLE + "\u0945";
// U+0947: "े" DEVANAGARI VOWEL SIGN E
static final String VOWEL_SIGN_E = DOTTED_CIRCLE + "\u0947";
// U+0948: "ै" DEVANAGARI VOWEL SIGN AI
static final String VOWEL_SIGN_AI = DOTTED_CIRCLE + "\u0948";
// U+0949: "ॉ" DEVANAGARI VOWEL SIGN CANDRA O
static final String VOWEL_SIGN_CANDRA_O = DOTTED_CIRCLE + "\u0949";
// U+094A: "ॊ" DEVANAGARI VOWEL SIGN SHORT O
static final String VOWEL_SIGN_SHORT_O = DOTTED_CIRCLE + "\u094A";
// U+094B: "ो" DEVANAGARI VOWEL SIGN O
static final String VOWEL_SIGN_O = DOTTED_CIRCLE + "\u094B";
// U+094C: "ौ" DEVANAGARI VOWEL SIGN AU
static final String VOWEL_SIGN_AU = DOTTED_CIRCLE + "\u094C";
// U+094D: "्" DEVANAGARI SIGN VIRAMA
static final String SIGN_VIRAMA = DOTTED_CIRCLE + "\u094D";
// U+0970: "॰" DEVANAGARI ABBREVIATION SIGN
static final String ABBREVIATION_SIGN = DOTTED_CIRCLE + "\u0970";
// U+097D: "" DEVANAGARI LETTER GLOTTAL STOP
static final String LETTER_GLOTTAL_STOP = DOTTED_CIRCLE + "\u097D";
}

View File

@ -16,6 +16,8 @@
package com.android.inputmethod.keyboard.layout; package com.android.inputmethod.keyboard.layout;
import static com.android.inputmethod.keyboard.layout.DevanagariLetterConstants.*;
import com.android.inputmethod.keyboard.KeyboardId; import com.android.inputmethod.keyboard.KeyboardId;
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey; import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder; import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
@ -96,25 +98,37 @@ public final class Hindi extends LayoutBase {
// U+094C: "ौ" DEVANAGARI VOWEL SIGN AU // U+094C: "ौ" DEVANAGARI VOWEL SIGN AU
// U+094C/U+0902: "ौं" DEVANAGARI VOWEL SIGN AU/DEVANAGARI SIGN ANUSVARA // U+094C/U+0902: "ौं" DEVANAGARI VOWEL SIGN AU/DEVANAGARI SIGN ANUSVARA
// U+0967: "१" DEVANAGARI DIGIT ONE // U+0967: "१" DEVANAGARI DIGIT ONE
key("\u094C", joinMoreKeys("\u094C\u0902", "\u0967", "1")), key(VOWEL_SIGN_AU, "\u094C", joinMoreKeys(
moreKey(VOWEL_SIGN_AU + "\u0902", "\u094C\u0902"),
"\u0967", "1")),
// U+0948: "ै" DEVANAGARI VOWEL SIGN AI // U+0948: "ै" DEVANAGARI VOWEL SIGN AI
// U+0948/U+0902: "ैं" DEVANAGARI VOWEL SIGN AI/DEVANAGARI SIGN ANUSVARA // U+0948/U+0902: "ैं" DEVANAGARI VOWEL SIGN AI/DEVANAGARI SIGN ANUSVARA
// U+0968: "२" DEVANAGARI DIGIT TWO // U+0968: "२" DEVANAGARI DIGIT TWO
key("\u0948", joinMoreKeys("\u0948\u0902", "\u0968", "2")), key(VOWEL_SIGN_AI, "\u0948", joinMoreKeys(
moreKey(VOWEL_SIGN_AI + "\u0902", "\u0948\u0902"),
"\u0968", "2")),
// U+093E: "ा" DEVANAGARI VOWEL SIGN AA // U+093E: "ा" DEVANAGARI VOWEL SIGN AA
// U+093E/U+0902: "ां" DEVANAGARI VOWEL SIGN AA/DEVANAGARI SIGN ANUSVARA // U+093E/U+0902: "ां" DEVANAGARI VOWEL SIGN AA/DEVANAGARI SIGN ANUSVARA
// U+093E/U+0901: "ाँ" DEVANAGARI VOWEL SIGN AA/DEVANAGARI SIGN CANDRABINDU // U+093E/U+0901: "ाँ" DEVANAGARI VOWEL SIGN AA/DEVANAGARI SIGN CANDRABINDU
// U+0969: "३" DEVANAGARI DIGIT THREE // U+0969: "३" DEVANAGARI DIGIT THREE
key("\u093E", joinMoreKeys("\u093E\u0902", "\u093E\u0901", "\u0969", "3")), key(VOWEL_SIGN_AA, "\u093E", joinMoreKeys(
moreKey(VOWEL_SIGN_AA + "\u0902", "\u093E\u0902"),
moreKey(VOWEL_SIGN_AA + "\u0901", "\u093E\u0901"),
"\u0969", "3")),
// U+0940: "ी" DEVANAGARI VOWEL SIGN II // U+0940: "ी" DEVANAGARI VOWEL SIGN II
// U+0940/U+0902: "ीं" DEVANAGARI VOWEL SIGN II/DEVANAGARI SIGN ANUSVARA // U+0940/U+0902: "ीं" DEVANAGARI VOWEL SIGN II/DEVANAGARI SIGN ANUSVARA
// U+096A: "४" DEVANAGARI DIGIT FOUR // U+096A: "४" DEVANAGARI DIGIT FOUR
key("\u0940", joinMoreKeys("\u0940\u0902", "\u096A", "4")), key(VOWEL_SIGN_II, "\u0940", joinMoreKeys(
moreKey(VOWEL_SIGN_II + "\u0902", "\u0940\u0902"),
"\u096A", "4")),
// U+0942: "ू" DEVANAGARI VOWEL SIGN UU // U+0942: "ू" DEVANAGARI VOWEL SIGN UU
// U+0942/U+0902: "ूं" DEVANAGARI VOWEL SIGN UU/DEVANAGARI SIGN ANUSVARA // U+0942/U+0902: "ूं" DEVANAGARI VOWEL SIGN UU/DEVANAGARI SIGN ANUSVARA
// U+0942/U+0901: "ूँ" DEVANAGARI VOWEL SIGN UU/DEVANAGARI SIGN CANDRABINDU // U+0942/U+0901: "ूँ" DEVANAGARI VOWEL SIGN UU/DEVANAGARI SIGN CANDRABINDU
// U+096B: "५" DEVANAGARI DIGIT FIVE // U+096B: "५" DEVANAGARI DIGIT FIVE
key("\u0942", joinMoreKeys("\u0942\u0902", "\u0942\u0901", "\u096B", "5")), key(VOWEL_SIGN_UU, "\u0942", joinMoreKeys(
moreKey(VOWEL_SIGN_UU + "\u0902", "\u0942\u0902"),
moreKey(VOWEL_SIGN_UU + "\u0901", "\u0942\u0901"),
"\u096B", "5")),
// U+092C: "ब" DEVANAGARI LETTER BA // U+092C: "ब" DEVANAGARI LETTER BA
// U+092C/U+0952: "ब॒" DEVANAGARI LETTER BA/DEVANAGARI STRESS SIGN ANUDATTA // U+092C/U+0952: "ब॒" DEVANAGARI LETTER BA/DEVANAGARI STRESS SIGN ANUDATTA
// U+096C: "६" DEVANAGARI DIGIT SIX // U+096C: "६" DEVANAGARI DIGIT SIX
@ -150,19 +164,26 @@ public final class Hindi extends LayoutBase {
// U+094B/U+0902: "қं" DEVANAGARI VOWEL SIGN O/DEVANAGARI SIGN ANUSVARA // U+094B/U+0902: "қं" DEVANAGARI VOWEL SIGN O/DEVANAGARI SIGN ANUSVARA
// U+0949: "ॉ" DEVANAGARI VOWEL SIGN CANDRA O // U+0949: "ॉ" DEVANAGARI VOWEL SIGN CANDRA O
// U+094A: "ॊ" DEVANAGARI VOWEL SIGN SHORT O // U+094A: "ॊ" DEVANAGARI VOWEL SIGN SHORT O
key("\u094B", joinMoreKeys("\u094B\u0902", "\u0949", "\u094A")), key(VOWEL_SIGN_O, "\u094B", joinMoreKeys(
moreKey(VOWEL_SIGN_O + "\u0902", "\u094B\u0902"),
moreKey(VOWEL_SIGN_CANDRA_O, "\u0949"),
moreKey(VOWEL_SIGN_SHORT_O, "\u094A"))),
// U+0947: "े" DEVANAGARI VOWEL SIGN E // U+0947: "े" DEVANAGARI VOWEL SIGN E
// U+0947/U+0902: "ें" DEVANAGARI VOWEL SIGN E/DEVANAGARI SIGN ANUSVARA // U+0947/U+0902: "ें" DEVANAGARI VOWEL SIGN E/DEVANAGARI SIGN ANUSVARA
key("\u0947", moreKey("\u0947\u0902")), key(VOWEL_SIGN_E, "\u0947",
moreKey(VOWEL_SIGN_E + "\u0902", "\u0947\u0902")),
// U+094D: "्" DEVANAGARI SIGN VIRAMA // U+094D: "्" DEVANAGARI SIGN VIRAMA
"\u094D", key(SIGN_VIRAMA, "\u094D"),
// U+093F: "ि" DEVANAGARI VOWEL SIGN I // U+093F: "ि" DEVANAGARI VOWEL SIGN I
// U+093F/U+0902: "िं" DEVANAGARI VOWEL SIGN I/DEVANAGARI SIGN ANUSVARA // U+093F/U+0902: "िं" DEVANAGARI VOWEL SIGN I/DEVANAGARI SIGN ANUSVARA
key("\u093F", moreKey("\u093F\u0902")), key(VOWEL_SIGN_I, "\u093F",
moreKey("\u093F" + SIGN_ANUSVARA, "\u093F\u0902")),
// U+0941: "ु" DEVANAGARI VOWEL SIGN U // U+0941: "ु" DEVANAGARI VOWEL SIGN U
// U+0941/U+0902: "ुं" DEVANAGARI VOWEL SIGN U/DEVANAGARI SIGN ANUSVARA // U+0941/U+0902: "ुं" DEVANAGARI VOWEL SIGN U/DEVANAGARI SIGN ANUSVARA
// U+0941/U+0901: "ुँ" DEVANAGARI VOWEL SIGN U/DEVANAGARI SIGN CANDRABINDU // U+0941/U+0901: "ुँ" DEVANAGARI VOWEL SIGN U/DEVANAGARI SIGN CANDRABINDU
key("\u0941", joinMoreKeys("\u0941\u0902", "\u0941\u0901")), key(VOWEL_SIGN_U, "\u0941", joinMoreKeys(
moreKey(VOWEL_SIGN_U + "\u0902", "\u0941\u0902"),
moreKey(VOWEL_SIGN_U + "\u0901", "\u0941\u0901"))),
// U+092A: "प" DEVANAGARI LETTER PA // U+092A: "प" DEVANAGARI LETTER PA
"\u092A", "\u092A",
// U+0930: "र" DEVANAGARI LETTER RA // U+0930: "र" DEVANAGARI LETTER RA
@ -182,8 +203,9 @@ public final class Hindi extends LayoutBase {
"\u091A","\u091F") "\u091A","\u091F")
.setKeysOfRow(3, .setKeysOfRow(3,
// U+0949: "ॉ" DEVANAGARI VOWEL SIGN CANDRA O // U+0949: "ॉ" DEVANAGARI VOWEL SIGN CANDRA O
key(VOWEL_SIGN_CANDRA_O, "\u0949"),
// U+0902: "ं" DEVANAGARI SIGN ANUSVARA // U+0902: "ं" DEVANAGARI SIGN ANUSVARA
"\u0949", "\u0902", key(SIGN_ANUSVARA, "\u0902"),
// U+092E: "म" DEVANAGARI LETTER MA // U+092E: "म" DEVANAGARI LETTER MA
// U+0950: "ॐ" DEVANAGARI OM // U+0950: "ॐ" DEVANAGARI OM
key("\u092E", moreKey("\u0950")), key("\u092E", moreKey("\u0950")),
@ -207,7 +229,10 @@ public final class Hindi extends LayoutBase {
// U+097D: "" DEVANAGARI LETTER GLOTTAL STOP // U+097D: "" DEVANAGARI LETTER GLOTTAL STOP
// U+0970: "॰" DEVANAGARI ABBREVIATION SIGN // U+0970: "॰" DEVANAGARI ABBREVIATION SIGN
// U+093D: "ऽ" DEVANAGARI SIGN AVAGRAHA // U+093D: "ऽ" DEVANAGARI SIGN AVAGRAHA
key("\u093C", joinMoreKeys("\u097D", "\u0970", "\u093D"))) key(SIGN_NUKTA, "\u093C", joinMoreKeys(
moreKey(LETTER_GLOTTAL_STOP, "\u097D"),
moreKey(ABBREVIATION_SIGN, "\u0970"),
moreKey(SIGN_AVAGRAHA, "\u093D"))))
.build(); .build();
private static final ExpectedKey[][] ALPHABET_SHIFTED_COMMON = new ExpectedKeyboardBuilder() private static final ExpectedKey[][] ALPHABET_SHIFTED_COMMON = new ExpectedKeyboardBuilder()
@ -232,7 +257,7 @@ public final class Hindi extends LayoutBase {
// U+092D: "भ" DEVANAGARI LETTER BHA // U+092D: "भ" DEVANAGARI LETTER BHA
// U+0903: "" DEVANAGARI SIGN VISARGA // U+0903: "" DEVANAGARI SIGN VISARGA
// U+0918: "घ" DEVANAGARI LETTER GHA // U+0918: "घ" DEVANAGARI LETTER GHA
"\u092D", "\u0903", "\u0918", "\u092D", key(SIGN_VISARGA, "\u0903"), "\u0918",
// U+0927: "ध" DEVANAGARI LETTER DHA // U+0927: "ध" DEVANAGARI LETTER DHA
// U+0915/U+094D/U+0937: // U+0915/U+094D/U+0937:
// "क्ष" DEVANAGARI LETTER KA/DEVANAGARI SIGN VIRAMA/DEVANAGARI LETTER SSA // "क्ष" DEVANAGARI LETTER KA/DEVANAGARI SIGN VIRAMA/DEVANAGARI LETTER SSA
@ -285,7 +310,7 @@ public final class Hindi extends LayoutBase {
"\u0911", "\u0911",
// U+0901: "ँ" DEVANAGARI SIGN CANDRABINDU // U+0901: "ँ" DEVANAGARI SIGN CANDRABINDU
// U+0945: "ॅ" DEVANAGARI VOWEL SIGN CANDRA E // U+0945: "ॅ" DEVANAGARI VOWEL SIGN CANDRA E
key("\u0901", moreKey("\u0945")), key(SIGN_CANDRABINDU, "\u0901", moreKey(VOWEL_SIGN_CANDRA_E, "\u0945")),
// U+0923: "ण" DEVANAGARI LETTER NNA // U+0923: "ण" DEVANAGARI LETTER NNA
// U+0929: "ऩ" DEVANAGARI LETTER NNNA // U+0929: "ऩ" DEVANAGARI LETTER NNNA
"\u0923", "\u0929", "\u0923", "\u0929",
@ -297,7 +322,7 @@ public final class Hindi extends LayoutBase {
"\u0936", "\u0937", "\u0936", "\u0937",
// U+0943: "ृ" DEVANAGARI VOWEL SIGN VOCALIC R // U+0943: "ृ" DEVANAGARI VOWEL SIGN VOCALIC R
// U+0944: "ॄ" DEVANAGARI VOWEL SIGN VOCALIC RR // U+0944: "ॄ" DEVANAGARI VOWEL SIGN VOCALIC RR
key("\u0943", moreKey("\u0944")), key(VOWEL_SIGN_VOCALIC_R, "\u0943", moreKey(VOWEL_SIGN_VOCALIC_RR, "\u0944")),
// U+091E: "ञ" DEVANAGARI LETTER NYA // U+091E: "ञ" DEVANAGARI LETTER NYA
"\u091E") "\u091E")
.build(); .build();

View File

@ -16,6 +16,8 @@
package com.android.inputmethod.keyboard.layout; package com.android.inputmethod.keyboard.layout;
import static com.android.inputmethod.keyboard.layout.DevanagariLetterConstants.*;
import com.android.inputmethod.keyboard.KeyboardId; import com.android.inputmethod.keyboard.KeyboardId;
import com.android.inputmethod.keyboard.layout.Hindi.HindiCustomizer; import com.android.inputmethod.keyboard.layout.Hindi.HindiCustomizer;
import com.android.inputmethod.keyboard.layout.Hindi.HindiSymbols; import com.android.inputmethod.keyboard.layout.Hindi.HindiSymbols;
@ -70,13 +72,14 @@ public final class NepaliRomanized extends LayoutBase {
// U+091F: "ट" DEVANAGARI LETTER TTA // U+091F: "ट" DEVANAGARI LETTER TTA
// U+0967: "१" DEVANAGARI DIGIT ONE // U+0967: "१" DEVANAGARI DIGIT ONE
// U+093C: "़" DEVANAGARI SIGN NUKTA // U+093C: "़" DEVANAGARI SIGN NUKTA
// TODO: Nukta should be moreKey(SIGN_NUKTA, "\u093C").
key("\u091F", joinMoreKeys("\u0967", "1", "\u093C")), key("\u091F", joinMoreKeys("\u0967", "1", "\u093C")),
// U+094C: "ौ" DEVANAGARI VOWEL SIGN AU // U+094C: "ौ" DEVANAGARI VOWEL SIGN AU
// U+0968: "२" DEVANAGARI DIGIT TWO // U+0968: "२" DEVANAGARI DIGIT TWO
key("\u094C", joinMoreKeys("\u0968", "2")), key(VOWEL_SIGN_AU, "\u094C", joinMoreKeys("\u0968", "2")),
// U+0947: "े" DEVANAGARI VOWEL SIGN E // U+0947: "े" DEVANAGARI VOWEL SIGN E
// U+0969: "३" DEVANAGARI DIGIT THREE // U+0969: "३" DEVANAGARI DIGIT THREE
key("\u0947", joinMoreKeys("\u0969", "3")), key(VOWEL_SIGN_E, "\u0947", joinMoreKeys("\u0969", "3")),
// U+0930: "र" DEVANAGARI LETTER RA // U+0930: "र" DEVANAGARI LETTER RA
// U+096A: "४" DEVANAGARI DIGIT FOUR // U+096A: "४" DEVANAGARI DIGIT FOUR
key("\u0930", joinMoreKeys("\u096A", "4")), key("\u0930", joinMoreKeys("\u096A", "4")),
@ -88,13 +91,13 @@ public final class NepaliRomanized extends LayoutBase {
key("\u092F", joinMoreKeys("\u096C", "6")), key("\u092F", joinMoreKeys("\u096C", "6")),
// U+0941: "ु" DEVANAGARI VOWEL SIGN U // U+0941: "ु" DEVANAGARI VOWEL SIGN U
// U+096D: "७" DEVANAGARI DIGIT SEVEN // U+096D: "७" DEVANAGARI DIGIT SEVEN
key("\u0941", joinMoreKeys("\u096D", "7")), key(VOWEL_SIGN_U, "\u0941", joinMoreKeys("\u096D", "7")),
// U+093F: "ि" DEVANAGARI VOWEL SIGN I // U+093F: "ि" DEVANAGARI VOWEL SIGN I
// U+096E: "८" DEVANAGARI DIGIT EIGHT // U+096E: "८" DEVANAGARI DIGIT EIGHT
key("\u093F", joinMoreKeys("\u096E", "8")), key(VOWEL_SIGN_I, "\u093F", joinMoreKeys("\u096E", "8")),
// U+094B: "ो" DEVANAGARI VOWEL SIGN O // U+094B: "ो" DEVANAGARI VOWEL SIGN O
// U+096F: "९" DEVANAGARI DIGIT NINE // U+096F: "९" DEVANAGARI DIGIT NINE
key("\u094B", joinMoreKeys("\u096F", "9")), key(VOWEL_SIGN_O, "\u094B", joinMoreKeys("\u096F", "9")),
// U+092A: "प" DEVANAGARI LETTER PA // U+092A: "प" DEVANAGARI LETTER PA
// U+0966: "" DEVANAGARI DIGIT ZERO // U+0966: "" DEVANAGARI DIGIT ZERO
key("\u092A", joinMoreKeys("\u0966", "0")), key("\u092A", joinMoreKeys("\u0966", "0")),
@ -102,6 +105,7 @@ public final class NepaliRomanized extends LayoutBase {
"\u0907") "\u0907")
.setKeysOfRow(2, .setKeysOfRow(2,
// U+093E: "ा" DEVANAGARI VOWEL SIGN AA // U+093E: "ा" DEVANAGARI VOWEL SIGN AA
key(VOWEL_SIGN_AA, "\u093E"),
// U+0938: "स" DEVANAGARI LETTER SA // U+0938: "स" DEVANAGARI LETTER SA
// U+0926: "द" DEVANAGARI LETTER DA // U+0926: "द" DEVANAGARI LETTER DA
// U+0909: "उ" DEVANAGARI LETTER U // U+0909: "उ" DEVANAGARI LETTER U
@ -112,8 +116,8 @@ public final class NepaliRomanized extends LayoutBase {
// U+0932: "ल" DEVANAGARI LETTER LA // U+0932: "ल" DEVANAGARI LETTER LA
// U+090F: "ए" DEVANAGARI LETTER E // U+090F: "ए" DEVANAGARI LETTER E
// U+0950: "ॐ" DEVANAGARI OM // U+0950: "ॐ" DEVANAGARI OM
"\u093E", "\u0938", "\u0926", "\u0909", "\u0917", "\u0939", "\u091C", "\u0915", "\u0938", "\u0926", "\u0909", "\u0917", "\u0939", "\u091C", "\u0915", "\u0932",
"\u0932", "\u090F", "\u0950") "\u090F", "\u0950")
.setKeysOfRow(3, .setKeysOfRow(3,
// U+0937: "ष" DEVANAGARI LETTER SSA // U+0937: "ष" DEVANAGARI LETTER SSA
// U+0921: "ड" DEVANAGARI LETTER DDA // U+0921: "ड" DEVANAGARI LETTER DDA
@ -127,23 +131,28 @@ public final class NepaliRomanized extends LayoutBase {
// U+093D: "ऽ" DEVANAGARI SIGN AVAGRAHA // U+093D: "ऽ" DEVANAGARI SIGN AVAGRAHA
key("\u0964", moreKey("\u093D")), key("\u0964", moreKey("\u093D")),
// U+094D: "्" DEVANAGARI SIGN VIRAMA // U+094D: "्" DEVANAGARI SIGN VIRAMA
"\u094D") key(SIGN_VIRAMA, "\u094D"))
.build(); .build();
private static final ExpectedKey[][] ALPHABET_SHIFTED_COMMON = new ExpectedKeyboardBuilder() private static final ExpectedKey[][] ALPHABET_SHIFTED_COMMON = new ExpectedKeyboardBuilder()
.setKeysOfRow(1, .setKeysOfRow(1,
// U+0920: "ठ" DEVANAGARI LETTER TTHA // U+0920: "ठ" DEVANAGARI LETTER TTHA
// U+0914: "औ" DEVANAGARI LETTER AU // U+0914: "औ" DEVANAGARI LETTER AU
"\u0920", "\u0914",
// U+0948: "ै" DEVANAGARI VOWEL SIGN AI // U+0948: "ै" DEVANAGARI VOWEL SIGN AI
key(VOWEL_SIGN_AI, "\u0948"),
// U+0943: "ृ" DEVANAGARI VOWEL SIGN VOCALIC R // U+0943: "ृ" DEVANAGARI VOWEL SIGN VOCALIC R
key(VOWEL_SIGN_VOCALIC_R, "\u0943"),
// U+0925: "थ" DEVANAGARI LETTER THA // U+0925: "थ" DEVANAGARI LETTER THA
// U+091E: "ञ" DEVANAGARI LETTER NYA // U+091E: "ञ" DEVANAGARI LETTER NYA
"\u0925", "\u091E",
// U+0942: "ू" DEVANAGARI VOWEL SIGN UU // U+0942: "ू" DEVANAGARI VOWEL SIGN UU
key(VOWEL_SIGN_UU, "\u0942"),
// U+0940: "ी" DEVANAGARI VOWEL SIGN II // U+0940: "ी" DEVANAGARI VOWEL SIGN II
key(VOWEL_SIGN_II, "\u0940"),
// U+0913: "ओ" DEVANAGARI LETTER O // U+0913: "ओ" DEVANAGARI LETTER O
// U+092B: "फ" DEVANAGARI LETTER PHA // U+092B: "फ" DEVANAGARI LETTER PHA
// U+0908: "ई" DEVANAGARI LETTER II // U+0908: "ई" DEVANAGARI LETTER II
"\u0920", "\u0914", "\u0948", "\u0943", "\u0925", "\u091E", "\u0942", "\u0940",
"\u0913", "\u092B", "\u0908") "\u0913", "\u092B", "\u0908")
.setKeysOfRow(2, .setKeysOfRow(2,
// U+0906: "आ" DEVANAGARI LETTER AA // U+0906: "आ" DEVANAGARI LETTER AA
@ -158,18 +167,22 @@ public final class NepaliRomanized extends LayoutBase {
// U+0910: "ऐ" DEVANAGARI LETTER AI // U+0910: "ऐ" DEVANAGARI LETTER AI
// U+0903: "" DEVANAGARI SIGN VISARGA // U+0903: "" DEVANAGARI SIGN VISARGA
"\u0906", "\u0936", "\u0927", "\u090A", "\u0918", "\u0905", "\u091D", "\u0916", "\u0906", "\u0936", "\u0927", "\u090A", "\u0918", "\u0905", "\u091D", "\u0916",
"\u0965", "\u0910", "\u0903") "\u0965", "\u0910", key(SIGN_VISARGA, "\u0903"))
.setKeysOfRow(3, .setKeysOfRow(3,
// U+090B: "ऋ" DEVANAGARI LETTER VOCALIC R // U+090B: "ऋ" DEVANAGARI LETTER VOCALIC R
// U+0922: "ढ" DEVANAGARI LETTER DDHA // U+0922: "ढ" DEVANAGARI LETTER DDHA
// U+091B: "छ" DEVANAGARI LETTER CHA // U+091B: "छ" DEVANAGARI LETTER CHA
"\u090B", "\u0922", "\u091B",
// U+0901: "ँ" DEVANAGARI SIGN CANDRABINDU // U+0901: "ँ" DEVANAGARI SIGN CANDRABINDU
key(SIGN_CANDRABINDU, "\u0901"),
// U+092D: "भ" DEVANAGARI LETTER BHA // U+092D: "भ" DEVANAGARI LETTER BHA
// U+0923: "ण" DEVANAGARI LETTER NNA // U+0923: "ण" DEVANAGARI LETTER NNA
"\u092D", "\u0923",
// U+0902: "ं" DEVANAGARI SIGN ANUSVARA // U+0902: "ं" DEVANAGARI SIGN ANUSVARA
key(SIGN_ANUSVARA, "\u0902"),
// U+0919: "ङ" DEVANAGARI LETTER NGA // U+0919: "ङ" DEVANAGARI LETTER NGA
"\u0919",
// U+094D: "्" DEVANAGARI SIGN VIRAMA // U+094D: "्" DEVANAGARI SIGN VIRAMA
"\u090B", "\u0922", "\u091B", "\u0901", "\u092D", "\u0923", "\u0902", "\u0919", key(SIGN_VIRAMA, "\u094D"))
"\u094D")
.build(); .build();
} }

View File

@ -16,6 +16,8 @@
package com.android.inputmethod.keyboard.layout; package com.android.inputmethod.keyboard.layout;
import static com.android.inputmethod.keyboard.layout.DevanagariLetterConstants.*;
import com.android.inputmethod.keyboard.KeyboardId; import com.android.inputmethod.keyboard.KeyboardId;
import com.android.inputmethod.keyboard.layout.Hindi.HindiSymbols; import com.android.inputmethod.keyboard.layout.Hindi.HindiSymbols;
import com.android.inputmethod.keyboard.layout.NepaliRomanized.NepaliRomanizedCustomizer; import com.android.inputmethod.keyboard.layout.NepaliRomanized.NepaliRomanizedCustomizer;
@ -47,7 +49,7 @@ public final class NepaliTraditional extends LayoutBase {
public ExpectedKey[] getKeysRightToSpacebar(final boolean isPhone) { public ExpectedKey[] getKeysRightToSpacebar(final boolean isPhone) {
if (isPhone) { if (isPhone) {
// U+094D: "्" DEVANAGARI SIGN VIRAMA // U+094D: "्" DEVANAGARI SIGN VIRAMA
return joinKeys(key("\u094D", PHONE_PUNCTUATION_MORE_KEYS)); return joinKeys(key(SIGN_VIRAMA, "\u094D", PHONE_PUNCTUATION_MORE_KEYS));
} }
return super.getKeysRightToSpacebar(isPhone); return super.getKeysRightToSpacebar(isPhone);
} }
@ -61,7 +63,8 @@ public final class NepaliTraditional extends LayoutBase {
// U+0947: "े" DEVANAGARI VOWEL SIGN E // U+0947: "े" DEVANAGARI VOWEL SIGN E
// U+0903: "" DEVANAGARI SIGN VISARGA // U+0903: "" DEVANAGARI SIGN VISARGA
// U+093D: "ऽ" DEVANAGARI SIGN AVAGRAHA // U+093D: "ऽ" DEVANAGARI SIGN AVAGRAHA
key("\u0947", joinMoreKeys("\u0903", "\u093D")), key(VOWEL_SIGN_E, "\u0947", joinMoreKeys(
moreKey(SIGN_VISARGA, "\u0903"), "\u093D")),
// U+0964: "।" DEVANAGARI DANDA // U+0964: "।" DEVANAGARI DANDA
"\u0964", "\u0964",
// U+0930: "र" DEVANAGARI LETTER RA // U+0930: "र" DEVANAGARI LETTER RA
@ -71,14 +74,15 @@ public final class NepaliTraditional extends LayoutBase {
builder.addKeysOnTheRightOfRow(3, builder.addKeysOnTheRightOfRow(3,
// U+0903: "" DEVANAGARI SIGN VISARGA // U+0903: "" DEVANAGARI SIGN VISARGA
// U+093D: "ऽ" DEVANAGARI SIGN AVAGRAHA // U+093D: "ऽ" DEVANAGARI SIGN AVAGRAHA
key("\u0903", moreKey("\u093D")), key(SIGN_VISARGA, "\u0903", moreKey("\u093D")),
// U+0947: "े" DEVANAGARI VOWEL SIGN E // U+0947: "े" DEVANAGARI VOWEL SIGN E
key(VOWEL_SIGN_E, "\u0947"),
// U+0964: "।" DEVANAGARI DANDA // U+0964: "।" DEVANAGARI DANDA
"\u0947", "\u0964", "\u0964",
// U+0930: "र" DEVANAGARI LETTER RA // U+0930: "र" DEVANAGARI LETTER RA
key("\u0930", moreKey("!")), key("\u0930", moreKey("!")),
// U+094D: "्" DEVANAGARI SIGN VIRAMA // U+094D: "्" DEVANAGARI SIGN VIRAMA
key("\u094D", moreKey("?"))); key(SIGN_VIRAMA, "\u094D", moreKey("?")));
} }
return builder.build(); return builder.build();
} }
@ -93,21 +97,23 @@ public final class NepaliTraditional extends LayoutBase {
if (isPhone) { if (isPhone) {
builder.addKeysOnTheRightOfRow(3, builder.addKeysOnTheRightOfRow(3,
// U+0902: "ं" DEVANAGARI SIGN ANUSVARA // U+0902: "ं" DEVANAGARI SIGN ANUSVARA
key(SIGN_ANUSVARA, "\u0902"),
// U+0919: "ङ" DEVANAGARI LETTER NGA // U+0919: "ङ" DEVANAGARI LETTER NGA
"\u0902", "\u0919", "\u0919",
// U+0948: "ै" DEVANAGARI VOWEL SIGN AI // U+0948: "ै" DEVANAGARI VOWEL SIGN AI
// U+0936/U+094D/U+0930: // U+0936/U+094D/U+0930:
// "श्र" DEVANAGARI LETTER SHA/DEVANAGARI SIGN VIRAMA/DEVANAGARI LETTER RA // "श्र" DEVANAGARI LETTER SHA/DEVANAGARI SIGN VIRAMA/DEVANAGARI LETTER RA
key("\u0948", moreKey("\u0936\u094D\u0930"))); key(VOWEL_SIGN_AI, "\u0948", moreKey("\u0936\u094D\u0930")));
} else { } else {
builder.addKeysOnTheRightOfRow(3, builder.addKeysOnTheRightOfRow(3,
// U+0902: "ं" DEVANAGARI SIGN ANUSVARA // U+0902: "ं" DEVANAGARI SIGN ANUSVARA
key(SIGN_ANUSVARA, "\u0902"),
// U+0919: "ङ" DEVANAGARI LETTER NGA // U+0919: "ङ" DEVANAGARI LETTER NGA
"\u0902", "\u0919", "\u0919",
// U+0948: "ै" DEVANAGARI VOWEL SIGN AI // U+0948: "ै" DEVANAGARI VOWEL SIGN AI
// U+0936/U+094D/U+0930: // U+0936/U+094D/U+0930:
// "श्र" DEVANAGARI LETTER SHA/DEVANAGARI SIGN VIRAMA/DEVANAGARI LETTER RA // "श्र" DEVANAGARI LETTER SHA/DEVANAGARI SIGN VIRAMA/DEVANAGARI LETTER RA
key("\u0948", moreKey("\u0936\u094D\u0930")), key(VOWEL_SIGN_AI, "\u0948", moreKey("\u0936\u094D\u0930")),
// U+0930/U+0941: "रु" DEVANAGARI LETTER RA/DEVANAGARI VOWEL SIGN U // U+0930/U+0941: "रु" DEVANAGARI LETTER RA/DEVANAGARI VOWEL SIGN U
key("\u0930\u0941", moreKey("!")), key("\u0930\u0941", moreKey("!")),
"?"); "?");
@ -154,16 +160,20 @@ public final class NepaliTraditional extends LayoutBase {
// U+092C: "ब" DEVANAGARI LETTER BA // U+092C: "ब" DEVANAGARI LETTER BA
// U+0915: "क" DEVANAGARI LETTER KA // U+0915: "क" DEVANAGARI LETTER KA
// U+092E: "म" DEVANAGARI LETTER MA // U+092E: "म" DEVANAGARI LETTER MA
"\u092C", "\u0915", "\u092E",
// U+093E: "ा" DEVANAGARI VOWEL SIGN AA // U+093E: "ा" DEVANAGARI VOWEL SIGN AA
key(VOWEL_SIGN_AA, "\u093E"),
// U+0928: "न" DEVANAGARI LETTER NA // U+0928: "न" DEVANAGARI LETTER NA
// U+091C: "ज" DEVANAGARI LETTER JA // U+091C: "ज" DEVANAGARI LETTER JA
// U+0935: "व" DEVANAGARI LETTER VA // U+0935: "व" DEVANAGARI LETTER VA
// U+092A: "प" DEVANAGARI LETTER PA // U+092A: "प" DEVANAGARI LETTER PA
"\u0928", "\u091C", "\u0935", "\u092A",
// U+093F: "ि" DEVANAGARI VOWEL SIGN I // U+093F: "ि" DEVANAGARI VOWEL SIGN I
key(VOWEL_SIGN_I, "\u093F"),
// U+0938: "स" DEVANAGARI LETTER SA // U+0938: "स" DEVANAGARI LETTER SA
"\u0938",
// U+0941: "ु" DEVANAGARI VOWEL SIGN U // U+0941: "ु" DEVANAGARI VOWEL SIGN U
"\u092C", "\u0915", "\u092E", "\u093E", "\u0928", "\u091C", "\u0935", "\u092A", key(VOWEL_SIGN_U, "\u0941"))
"\u093F", "\u0938", "\u0941")
.setKeysOfRow(3, .setKeysOfRow(3,
// U+0936: "श" DEVANAGARI LETTER SHA // U+0936: "श" DEVANAGARI LETTER SHA
// U+0939: "ह" DEVANAGARI LETTER HA // U+0939: "ह" DEVANAGARI LETTER HA
@ -219,34 +229,41 @@ public final class NepaliTraditional extends LayoutBase {
key("\u090F", moreKey("\u0923")), key("\u090F", moreKey("\u0923")),
// U+0943: "ृ" DEVANAGARI VOWEL SIGN VOCALIC R // U+0943: "ृ" DEVANAGARI VOWEL SIGN VOCALIC R
// U+0913: "ओ" DEVANAGARI LETTER O // U+0913: "ओ" DEVANAGARI LETTER O
key("\u0943", moreKey("\u0913"))) key(VOWEL_SIGN_VOCALIC_R, "\u0943", moreKey("\u0913")))
.setKeysOfRow(2, .setKeysOfRow(2,
// U+0906: "आ" DEVANAGARI LETTER AA // U+0906: "आ" DEVANAGARI LETTER AA
// U+0919/U+094D: "ङ्" DEVANAGARI LETTER NGA/DEVANAGARI SIGN VIRAMA // U+0919/U+094D: "ङ्" DEVANAGARI LETTER NGA/DEVANAGARI SIGN VIRAMA
// U+0921/U+094D/U+0921: // U+0921/U+094D/U+0921:
// "ड्ड" DEVANAGARI LETTER DDA/DEVANAGARI SIGN VIRAMA/DEVANAGARI LETTER DDA // "ड्ड" DEVANAGARI LETTER DDA/DEVANAGARI SIGN VIRAMA/DEVANAGARI LETTER DDA
"\u0906", "\u0919\u094D", "\u0921\u094D\u0921",
// U+0901: "ँ" DEVANAGARI SIGN CANDRABINDU // U+0901: "ँ" DEVANAGARI SIGN CANDRABINDU
key(SIGN_CANDRABINDU, "\u0901"),
// U+0926/U+094D/U+0926: // U+0926/U+094D/U+0926:
// "द्द" DEVANAGARI LETTER DA/DEVANAGARI SIGN VIRAMA/DEVANAGARI LETTER DA // "द्द" DEVANAGARI LETTER DA/DEVANAGARI SIGN VIRAMA/DEVANAGARI LETTER DA
// U+091D: "झ" DEVANAGARI LETTER JHA // U+091D: "झ" DEVANAGARI LETTER JHA
"\u0926\u094D\u0926", "\u091D",
// U+094B: "ो" DEVANAGARI VOWEL SIGN O // U+094B: "ो" DEVANAGARI VOWEL SIGN O
key(VOWEL_SIGN_O, "\u094B"),
// U+092B: "फ" DEVANAGARI LETTER PHA // U+092B: "फ" DEVANAGARI LETTER PHA
"\u092B",
// U+0940: "ी" DEVANAGARI VOWEL SIGN II // U+0940: "ी" DEVANAGARI VOWEL SIGN II
key(VOWEL_SIGN_II, "\u0940"),
// U+091F/U+094D/U+0920: // U+091F/U+094D/U+0920:
// "ट्ठ" DEVANAGARI LETTER TTA/DEVANAGARI SIGN VIRAMA/DEVANAGARI LETTER TTHA // "ट्ठ" DEVANAGARI LETTER TTA/DEVANAGARI SIGN VIRAMA/DEVANAGARI LETTER TTHA
"\u091F\u094D\u0920",
// U+0942: "ू" DEVANAGARI VOWEL SIGN UU // U+0942: "ू" DEVANAGARI VOWEL SIGN UU
"\u0906", "\u0919\u094D", "\u0921\u094D\u0921", "\u0901", "\u0926\u094D\u0926", key(VOWEL_SIGN_UU, "\u0942"))
"\u091D", "\u094B", "\u092B", "\u0940", "\u091F\u094D\u0920", "\u0942")
.setKeysOfRow(3, .setKeysOfRow(3,
// U+0915/U+094D: "क्" DEVANAGARI LETTER KA/DEVANAGARI SIGN VIRAMA // U+0915/U+094D: "क्" DEVANAGARI LETTER KA/DEVANAGARI SIGN VIRAMA
// U+0939/U+094D/U+092E: // U+0939/U+094D/U+092E:
// "ह्म" DEVANAGARI LETTER HA/DEVANAGARI SIGN VIRAMA/DEVANAGARI LETTER MA // "ह्म" DEVANAGARI LETTER HA/DEVANAGARI SIGN VIRAMA/DEVANAGARI LETTER MA
// U+090B: "ऋ" DEVANAGARI LETTER VOCALIC R // U+090B: "ऋ" DEVANAGARI LETTER VOCALIC R
// U+0950: "ॐ" DEVANAGARI OM // U+0950: "ॐ" DEVANAGARI OM
"\u0915\u094D", "\u0939\u094D\u092E", "\u090B", "\u0950",
// U+094C: "ौ" DEVANAGARI VOWEL SIGN AU // U+094C: "ौ" DEVANAGARI VOWEL SIGN AU
key(VOWEL_SIGN_AU, "\u094C"),
// U+0926/U+094D/U+092F: // U+0926/U+094D/U+092F:
// "द्य" DEVANAGARI LETTER DA/DEVANAGARI SIGN VIRAMA/DEVANAGARI LETTER YA // "द्य" DEVANAGARI LETTER DA/DEVANAGARI SIGN VIRAMA/DEVANAGARI LETTER YA
"\u0915\u094D", "\u0939\u094D\u092E", "\u090B", "\u0950", "\u094C",
"\u0926\u094D\u092F") "\u0926\u094D\u092F")
.build(); .build();
} }