Skip to content
Snippets Groups Projects
Commit 826186f6 authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka
Browse files

Use Devanagari Danda letter as full stop on Nepali keyboard

Bug: 17741882
Change-Id: I62e8c9a3f194b9a3a6724c7d1a92292b150ddeb9
parent 3d7681d8
No related branches found
No related tags found
No related merge requests found
Showing
with 217 additions and 361 deletions
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
latin:keyWidth="fillRight" /> latin:keyWidth="fillRight" />
</Row> </Row>
<Row <Row
latin:keyWidth="8.182%p" latin:keyWidth="8.0%p"
latin:keyLabelFlags="fontNormal" latin:keyLabelFlags="fontNormal"
> >
<Key <Key
...@@ -47,6 +47,9 @@ ...@@ -47,6 +47,9 @@
latin:keyWidth="10.0%p" /> latin:keyWidth="10.0%p" />
<include latin:keyboardLayout="@xml/rowkeys_nepali_romanized3" /> <include latin:keyboardLayout="@xml/rowkeys_nepali_romanized3" />
<include latin:keyboardLayout="@xml/keys_exclamation_question" /> <include latin:keyboardLayout="@xml/keys_exclamation_question" />
<Key
latin:keyStyle="shiftKeyStyle"
latin:keyWidth="fillRight" />
</Row> </Row>
<include latin:keyboardLayout="@xml/row_qwerty4" /> <include latin:keyboardLayout="@xml/row_qwerty4" />
</merge> </merge>
...@@ -45,8 +45,8 @@ ...@@ -45,8 +45,8 @@
<Key <Key
latin:keyStyle="shiftKeyStyle" latin:keyStyle="shiftKeyStyle"
latin:keyWidth="10.0%p" /> latin:keyWidth="10.0%p" />
<include latin:keyboardLayout="@xml/rowkeys_nepali_traditional3_left6" /> <include latin:keyboardLayout="@xml/rowkeys_nepali_traditional3" />
<include latin:keyboardLayout="@xml/rowkeys_nepali_traditional3_right5" /> <include latin:keyboardLayout="@xml/keys_exclamation_question" />
</Row> </Row>
<include latin:keyboardLayout="@xml/row_qwerty4" /> <include latin:keyboardLayout="@xml/row_qwerty4" />
</merge> </merge>
...@@ -22,21 +22,6 @@ ...@@ -22,21 +22,6 @@
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
> >
<switch> <switch>
<case
latin:languageCode="ne"
latin:keyboardLayoutSet="nepali_traditional"
>
<!-- Because the font rendering system prior to API version 16 can't automatically
render dotted circle for incomplete combining letter of some scripts, different
set of Key definitions are needed based on the API version. -->
<include
latin:keyboardLayout="@xml/keystyle_devanagari_sign_virama" />
<Key
latin:keyStyle="baseKeyDevanagariSignVirama"
latin:keyLabelFlags="hasPopupHint"
latin:moreKeys="!text/morekeys_punctuation"
latin:backgroundType="functional" />
</case>
<case <case
latin:keyboardLayoutSet="dvorak" latin:keyboardLayoutSet="dvorak"
> >
......
...@@ -43,11 +43,6 @@ ...@@ -43,11 +43,6 @@
<Key latin:keyStyle="baseKeyDevanagariSignAnusvara" /> <Key latin:keyStyle="baseKeyDevanagariSignAnusvara" />
<!-- U+0919: "ङ" DEVANAGARI LETTER NGA --> <!-- U+0919: "ङ" DEVANAGARI LETTER NGA -->
<Key latin:keySpec="&#x0919;" /> <Key latin:keySpec="&#x0919;" />
<!-- Because the font rendering system prior to API version 16 can't automatically
render dotted circle for incomplete combining letter of some scripts, different
set of Key definitions are needed based on the API version. -->
<include latin:keyboardLayout="@xml/keystyle_devanagari_sign_virama" />
<Key latin:keyStyle="baseKeyDevanagariSignVirama" />
</case> </case>
<default> <default>
<!-- U+0937: "ष" DEVANAGARI LETTER SSA --> <!-- U+0937: "ष" DEVANAGARI LETTER SSA -->
...@@ -64,16 +59,14 @@ ...@@ -64,16 +59,14 @@
<Key latin:keySpec="&#x0928;" /> <Key latin:keySpec="&#x0928;" />
<!-- U+092E: "म" DEVANAGARI LETTER MA --> <!-- U+092E: "म" DEVANAGARI LETTER MA -->
<Key latin:keySpec="&#x092E;" /> <Key latin:keySpec="&#x092E;" />
<!-- U+0964: "।" DEVANAGARI DANDA
U+093D: "ऽ" DEVANAGARI SIGN AVAGRAHA -->
<Key
latin:keySpec="&#x0964;"
latin:moreKeys="&#x093D;" />
<!-- Because the font rendering system prior to API version 16 can't automatically <!-- Because the font rendering system prior to API version 16 can't automatically
render dotted circle for incomplete combining letter of some scripts, different render dotted circle for incomplete combining letter of some scripts, different
set of Key definitions are needed based on the API version. --> set of Key definitions are needed based on the API version. -->
<include latin:keyboardLayout="@xml/keystyle_devanagari_sign_virama" /> <include latin:keyboardLayout="@xml/keystyle_devanagari_sign_virama" />
<Key latin:keyStyle="baseKeyDevanagariSignVirama" /> <!-- U+093D: "ऽ" DEVANAGARI SIGN AVAGRAHA -->
<Key
latin:keyStyle="baseKeyDevanagariSignVirama"
latin:moreKeys="&#x093D;" />
</default> </default>
</switch> </switch>
</merge> </merge>
...@@ -21,6 +21,27 @@ ...@@ -21,6 +21,27 @@
<merge xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"> <merge xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin">
<switch> <switch>
<case latin:keyboardLayoutSetElement="alphabetManualShifted|alphabetShiftLocked|alphabetShiftLockShifted"> <case latin:keyboardLayoutSetElement="alphabetManualShifted|alphabetShiftLocked|alphabetShiftLockShifted">
<!-- U+0915/U+094D: "क्" DEVANAGARI LETTER KA/DEVANAGARI SIGN VIRAMA -->
<Key
latin:keySpec="&#x0915;&#x094D;"
latin:keyLabelFlags="followKeyLetterRatio" />
<!-- U+0939/U+094D/U+092E: "ह्म" DEVANAGARI LETTER HA/DEVANAGARI SIGN VIRAMA/DEVANAGARI LETTER MA -->
<Key
latin:keySpec="&#x0939;&#x094D;&#x092E;"
latin:keyLabelFlags="followKeyLetterRatio" />
<!-- U+090B: "ऋ" DEVANAGARI LETTER VOCALIC R -->
<Key latin:keySpec="&#x090B;" />
<!-- U+0950: "ॐ" DEVANAGARI OM -->
<Key latin:keySpec="&#x0950;" />
<!-- Because the font rendering system prior to API version 16 can't automatically
render dotted circle for incomplete combining letter of some scripts, different
set of Key definitions are needed based on the API version. -->
<include latin:keyboardLayout="@xml/keystyle_devanagari_vowel_sign_au" />
<Key latin:keyStyle="baseKeyDevanagariVowelSignAu" />
<!-- U+0926/U+094D/U+092F: "द्य" DEVANAGARI LETTER DA/DEVANAGARI SIGN VIRAMA/DEVANAGARI LETTER YA -->
<Key
latin:keySpec="&#x0926;&#x094D;&#x092F;"
latin:keyLabelFlags="followKeyLetterRatio" />
<!-- Because the font rendering system prior to API version 16 can't automatically <!-- Because the font rendering system prior to API version 16 can't automatically
render dotted circle for incomplete combining letter of some scripts, different render dotted circle for incomplete combining letter of some scripts, different
set of Key definitions are needed based on the API version. --> set of Key definitions are needed based on the API version. -->
...@@ -33,44 +54,36 @@ ...@@ -33,44 +54,36 @@
set of Key definitions are needed based on the API version. --> set of Key definitions are needed based on the API version. -->
<include latin:keyboardLayout="@xml/keystyle_devanagari_vowel_sign_ai" /> <include latin:keyboardLayout="@xml/keystyle_devanagari_vowel_sign_ai" />
<Key latin:keyStyle="baseKeyDevanagariVowelSignAi" /> <Key latin:keyStyle="baseKeyDevanagariVowelSignAi" />
<!-- U+0930/U+0941: "रु" DEVANAGARI LETTER RA/DEVANAGARI VOWEL SIGN U -->
<Key
latin:keySpec="&#x0930;&#x0941;"
latin:moreKeys="!"
latin:keyLabelFlags="followKeyLetterRatio" />
<Key
latin:keySpec="\?"
latin:keyLabelFlags="fontDefault" />
</case> </case>
<default> <default>
<!-- Because the font rendering system prior to API version 16 can't automatically <!-- U+0936: "श" DEVANAGARI LETTER SHA -->
render dotted circle for incomplete combining letter of some scripts, different <Key latin:keySpec="&#x0936;" />
set of Key definitions are needed based on the API version. --> <!-- U+0939: "ह" DEVANAGARI LETTER HA -->
<include latin:keyboardLayout="@xml/keystyle_devanagari_sign_visarga" /> <Key latin:keySpec="&#x0939;" />
<!-- U+093D: "ऽ" DEVANAGARI SIGN AVAGRAHA --> <!-- U+0905: "अ" DEVANAGARI LETTER A -->
<Key <Key latin:keySpec="&#x0905;" />
latin:keyStyle="baseKeyDevanagariSignVisarga" <!-- U+0916: "ख" DEVANAGARI LETTER KHA -->
latin:moreKeys="&#x093D;" /> <Key latin:keySpec="&#x0916;" />
<!-- U+0926: "द" DEVANAGARI LETTER DA -->
<Key latin:keySpec="&#x0926;" />
<!-- U+0932: "ल" DEVANAGARI LETTER LA -->
<Key latin:keySpec="&#x0932;" />
<!-- Because the font rendering system prior to API version 16 can't automatically <!-- Because the font rendering system prior to API version 16 can't automatically
render dotted circle for incomplete combining letter of some scripts, different render dotted circle for incomplete combining letter of some scripts, different
set of Key definitions are needed based on the API version. --> set of Key definitions are needed based on the API version. -->
<include latin:keyboardLayout="@xml/keystyle_devanagari_vowel_sign_e" /> <include latin:keyboardLayout="@xml/keystyle_devanagari_vowel_sign_e" />
<!-- Override more keys with empty definition -->
<key-style latin:styleName="moreKeysDevanagariVowelSignE" />
<Key latin:keyStyle="baseKeyDevanagariVowelSignE" /> <Key latin:keyStyle="baseKeyDevanagariVowelSignE" />
<!-- U+0964: "।" DEVANAGARI DANDA -->
<Key latin:keySpec="&#x0964;" />
<!-- U+0930: "र" DEVANAGARI LETTER RA -->
<Key
latin:keySpec="&#x0930;"
latin:moreKeys="!" />
<!-- Because the font rendering system prior to API version 16 can't automatically <!-- Because the font rendering system prior to API version 16 can't automatically
render dotted circle for incomplete combining letter of some scripts, different render dotted circle for incomplete combining letter of some scripts, different
set of Key definitions are needed based on the API version. --> set of Key definitions are needed based on the API version. -->
<include latin:keyboardLayout="@xml/keystyle_devanagari_sign_virama" /> <include
latin:keyboardLayout="@xml/keystyle_devanagari_sign_virama" />
<Key latin:keyStyle="baseKeyDevanagariSignVirama" />
<!-- U+0930: "र" DEVANAGARI LETTER RA
U+0930/U+0941: "रु" DEVANAGARI LETTER RA/DEVANAGARI VOWEL SIGN U -->
<Key <Key
latin:keyStyle="baseKeyDevanagariSignVirama" latin:keySpec="&#x0930;"
latin:moreKeys="\?" /> latin:moreKeys="&#x0930;&#x0941;" />
</default> </default>
</switch> </switch>
</merge> </merge>
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2013, 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">
<switch>
<case latin:keyboardLayoutSetElement="alphabetManualShifted|alphabetShiftLocked|alphabetShiftLockShifted">
<!-- U+0915/U+094D: "क्" DEVANAGARI LETTER KA/DEVANAGARI SIGN VIRAMA -->
<Key
latin:keySpec="&#x0915;&#x094D;"
latin:keyLabelFlags="followKeyLetterRatio" />
<!-- U+0939/U+094D/U+092E: "ह्म" DEVANAGARI LETTER HA/DEVANAGARI SIGN VIRAMA/DEVANAGARI LETTER MA -->
<Key
latin:keySpec="&#x0939;&#x094D;&#x092E;"
latin:keyLabelFlags="followKeyLetterRatio" />
<!-- U+090B: "ऋ" DEVANAGARI LETTER VOCALIC R -->
<Key latin:keySpec="&#x090B;" />
<!-- U+0950: "ॐ" DEVANAGARI OM -->
<Key latin:keySpec="&#x0950;" />
<!-- Because the font rendering system prior to API version 16 can't automatically
render dotted circle for incomplete combining letter of some scripts, different
set of Key definitions are needed based on the API version. -->
<include latin:keyboardLayout="@xml/keystyle_devanagari_vowel_sign_au" />
<Key latin:keyStyle="baseKeyDevanagariVowelSignAu" />
<!-- U+0926/U+094D/U+092F: "द्य" DEVANAGARI LETTER DA/DEVANAGARI SIGN VIRAMA/DEVANAGARI LETTER YA -->
<Key
latin:keySpec="&#x0926;&#x094D;&#x092F;"
latin:keyLabelFlags="followKeyLetterRatio" />
</case>
<default>
<!-- U+0936: "श" DEVANAGARI LETTER SHA -->
<Key latin:keySpec="&#x0936;" />
<!-- U+0939: "ह" DEVANAGARI LETTER HA -->
<Key latin:keySpec="&#x0939;" />
<!-- U+0905: "अ" DEVANAGARI LETTER A -->
<Key latin:keySpec="&#x0905;" />
<!-- U+0916: "ख" DEVANAGARI LETTER KHA -->
<Key latin:keySpec="&#x0916;" />
<!-- U+0926: "द" DEVANAGARI LETTER DA -->
<Key latin:keySpec="&#x0926;" />
<!-- U+0932: "ल" DEVANAGARI LETTER LA -->
<Key latin:keySpec="&#x0932;" />
</default>
</switch>
</merge>
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2013, 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">
<switch>
<case latin:keyboardLayoutSetElement="alphabetManualShifted|alphabetShiftLocked|alphabetShiftLockShifted">
<!-- Because the font rendering system prior to API version 16 can't automatically
render dotted circle for incomplete combining letter of some scripts, different
set of Key definitions are needed based on the API version. -->
<include latin:keyboardLayout="@xml/keystyle_devanagari_sign_anusvara" />
<Key latin:keyStyle="baseKeyDevanagariSignAnusvara" />
<!-- U+0919: "ङ" DEVANAGARI LETTER NGA -->
<Key latin:keySpec="&#x0919;" />
<!-- Because the font rendering system prior to API version 16 can't automatically
render dotted circle for incomplete combining letter of some scripts, different
set of Key definitions are needed based on the API version. -->
<include latin:keyboardLayout="@xml/keystyle_devanagari_vowel_sign_ai" />
<Key latin:keyStyle="baseKeyDevanagariVowelSignAi" />
</case>
<default>
<!-- Because the font rendering system prior to API version 16 can't automatically
render dotted circle for incomplete combining letter of some scripts, different
set of Key definitions are needed based on the API version. -->
<include latin:keyboardLayout="@xml/keystyle_devanagari_vowel_sign_e" />
<Key latin:keyStyle="baseKeyDevanagariVowelSignE" />
<!-- U+0964: "।" DEVANAGARI DANDA -->
<Key latin:keySpec="&#x0964;" />
<!-- U+0930: "र" DEVANAGARI LETTER RA
U+0930/U+0941: "रु" DEVANAGARI LETTER RA/DEVANAGARI VOWEL SIGN U -->
<Key
latin:keySpec="&#x0930;"
latin:moreKeys="&#x0930;&#x0941;" />
</default>
</switch>
</merge>
...@@ -33,16 +33,18 @@ ...@@ -33,16 +33,18 @@
<include latin:keyboardLayout="@xml/rowkeys_nepali_romanized2" /> <include latin:keyboardLayout="@xml/rowkeys_nepali_romanized2" />
</Row> </Row>
<Row <Row
latin:keyWidth="8.711%p" latin:keyWidth="8.75%p"
latin:keyLabelFlags="fontNormal" latin:keyLabelFlags="fontNormal"
> >
<Key <Key
latin:keyStyle="shiftKeyStyle" latin:keyStyle="shiftKeyStyle"
latin:keyWidth="10.8%p" /> latin:keyWidth="15%p"
latin:visualInsetsRight="1%p" />
<include latin:keyboardLayout="@xml/rowkeys_nepali_romanized3" /> <include latin:keyboardLayout="@xml/rowkeys_nepali_romanized3" />
<Key <Key
latin:keyStyle="deleteKeyStyle" latin:keyStyle="deleteKeyStyle"
latin:keyWidth="fillRight" /> latin:keyWidth="fillRight"
latin:visualInsetsLeft="1%p" />
</Row> </Row>
<include latin:keyboardLayout="@xml/row_qwerty4" /> <include latin:keyboardLayout="@xml/row_qwerty4" />
</merge> </merge>
...@@ -40,8 +40,7 @@ ...@@ -40,8 +40,7 @@
<Key <Key
latin:keyStyle="shiftKeyStyle" latin:keyStyle="shiftKeyStyle"
latin:keyWidth="10.8%p" /> latin:keyWidth="10.8%p" />
<include latin:keyboardLayout="@xml/rowkeys_nepali_traditional3_left6" /> <include latin:keyboardLayout="@xml/rowkeys_nepali_traditional3" />
<include latin:keyboardLayout="@xml/rowkeys_nepali_traditional3_right3" />
<Key <Key
latin:keyStyle="deleteKeyStyle" latin:keyStyle="deleteKeyStyle"
latin:keyWidth="fillRight" /> latin:keyWidth="fillRight" />
......
...@@ -33,26 +33,17 @@ public final class NepaliRomanized extends LayoutBase { ...@@ -33,26 +33,17 @@ public final class NepaliRomanized extends LayoutBase {
private static final String LAYOUT_NAME = "nepali_romanized"; private static final String LAYOUT_NAME = "nepali_romanized";
public NepaliRomanized(final Locale locale) { public NepaliRomanized(final Locale locale) {
super(new NepaliRomanizedCustomizer(locale), HindiSymbols.class, SymbolsShifted.class); super(new NepaliCustomizer(locale), HindiSymbols.class, SymbolsShifted.class);
} }
@Override @Override
public String getName() { return LAYOUT_NAME; } public String getName() { return LAYOUT_NAME; }
private static class NepaliRomanizedCustomizer extends NepaliCustomizer {
NepaliRomanizedCustomizer(final Locale locale) { super(locale); }
@Override
public ExpectedKey[] getRightShiftKeys(final boolean isPhone) {
return isPhone ? EMPTY_KEYS : EXCLAMATION_AND_QUESTION_MARKS;
}
}
@Override @Override
ExpectedKey[][] getCommonAlphabetLayout(boolean isPhone) { return ALPHABET_COMMON; } ExpectedKey[][] getCommonAlphabetLayout(final boolean isPhone) { return ALPHABET_COMMON; }
@Override @Override
ExpectedKey[][] getCommonAlphabetShiftLayout(boolean isPhone, final int elementId) { ExpectedKey[][] getCommonAlphabetShiftLayout(final boolean isPhone, final int elementId) {
if (elementId == KeyboardId.ELEMENT_ALPHABET_AUTOMATIC_SHIFTED) { if (elementId == KeyboardId.ELEMENT_ALPHABET_AUTOMATIC_SHIFTED) {
return getCommonAlphabetLayout(isPhone); return getCommonAlphabetLayout(isPhone);
} }
...@@ -118,11 +109,9 @@ public final class NepaliRomanized extends LayoutBase { ...@@ -118,11 +109,9 @@ public final class NepaliRomanized extends LayoutBase {
// U+0928: "न" DEVANAGARI LETTER NA // U+0928: "न" DEVANAGARI LETTER NA
// U+092E: "म" DEVANAGARI LETTER MA // U+092E: "म" DEVANAGARI LETTER MA
"\u0937", "\u0921", "\u091A", "\u0935", "\u092C", "\u0928", "\u092E", "\u0937", "\u0921", "\u091A", "\u0935", "\u092C", "\u0928", "\u092E",
// U+0964: "।" DEVANAGARI DANDA
// U+093D: "ऽ" DEVANAGARI SIGN AVAGRAHA
key("\u0964", moreKey("\u093D")),
// U+094D: "्" DEVANAGARI SIGN VIRAMA // U+094D: "्" DEVANAGARI SIGN VIRAMA
key(SIGN_VIRAMA, "\u094D")) // U+093D: "ऽ" DEVANAGARI SIGN AVAGRAHA
key(SIGN_VIRAMA, "\u094D", moreKey("\u093D")))
.build(); .build();
private static final ExpectedKey[][] ALPHABET_SHIFTED_COMMON = new ExpectedKeyboardBuilder() private static final ExpectedKey[][] ALPHABET_SHIFTED_COMMON = new ExpectedKeyboardBuilder()
...@@ -172,8 +161,6 @@ public final class NepaliRomanized extends LayoutBase { ...@@ -172,8 +161,6 @@ public final class NepaliRomanized extends LayoutBase {
// U+0902: "ं" DEVANAGARI SIGN ANUSVARA // U+0902: "ं" DEVANAGARI SIGN ANUSVARA
key(SIGN_ANUSVARA, "\u0902"), key(SIGN_ANUSVARA, "\u0902"),
// U+0919: "ङ" DEVANAGARI LETTER NGA // U+0919: "ङ" DEVANAGARI LETTER NGA
"\u0919", "\u0919")
// U+094D: "्" DEVANAGARI SIGN VIRAMA
key(SIGN_VIRAMA, "\u094D"))
.build(); .build();
} }
...@@ -43,82 +43,20 @@ public final class NepaliTraditional extends LayoutBase { ...@@ -43,82 +43,20 @@ public final class NepaliTraditional extends LayoutBase {
NepaliTraditionalCustomizer(final Locale locale) { super(locale); } NepaliTraditionalCustomizer(final Locale locale) { super(locale); }
@Override @Override
public ExpectedKey[] getRightShiftKeys(final boolean isPhone) { return EMPTY_KEYS; } public ExpectedKey[] getRightShiftKeys(final boolean isPhone) {
return isPhone ? EMPTY_KEYS : EXCLAMATION_AND_QUESTION_MARKS;
@Override
public ExpectedKey[] getKeysRightToSpacebar(final boolean isPhone) {
if (isPhone) {
// U+094D: "्" DEVANAGARI SIGN VIRAMA
return joinKeys(key(SIGN_VIRAMA, "\u094D", PHONE_PUNCTUATION_MORE_KEYS));
}
return super.getKeysRightToSpacebar(isPhone);
} }
} }
@Override @Override
ExpectedKey[][] getCommonAlphabetLayout(boolean isPhone) { ExpectedKey[][] getCommonAlphabetLayout(final boolean isPhone) { return ALPHABET_COMMON; }
final ExpectedKeyboardBuilder builder = new ExpectedKeyboardBuilder(ALPHABET_COMMON);
if (isPhone) {
builder.addKeysOnTheRightOfRow(3,
// U+0947: "े" DEVANAGARI VOWEL SIGN E
// U+0903: "ः‍" DEVANAGARI SIGN VISARGA
// U+093D: "ऽ" DEVANAGARI SIGN AVAGRAHA
key(VOWEL_SIGN_E, "\u0947", joinMoreKeys(
moreKey(SIGN_VISARGA, "\u0903"), "\u093D")),
// U+0964: "।" DEVANAGARI DANDA
"\u0964",
// U+0930: "र" DEVANAGARI LETTER RA
// U+0930/U+0941: "रु" DEVANAGARI LETTER RA/DEVANAGARI VOWEL SIGN U
key("\u0930", moreKey("\u0930\u0941")));
} else {
builder.addKeysOnTheRightOfRow(3,
// U+0903: "ः" DEVANAGARI SIGN VISARGA
// U+093D: "ऽ" DEVANAGARI SIGN AVAGRAHA
key(SIGN_VISARGA, "\u0903", moreKey("\u093D")),
// U+0947: "े" DEVANAGARI VOWEL SIGN E
key(VOWEL_SIGN_E, "\u0947"),
// U+0964: "।" DEVANAGARI DANDA
"\u0964",
// U+0930: "र" DEVANAGARI LETTER RA
key("\u0930", moreKey("!")),
// U+094D: "्" DEVANAGARI SIGN VIRAMA
key(SIGN_VIRAMA, "\u094D", moreKey("?")));
}
return builder.build();
}
@Override @Override
ExpectedKey[][] getCommonAlphabetShiftLayout(boolean isPhone, final int elementId) { ExpectedKey[][] getCommonAlphabetShiftLayout(final boolean isPhone, final int elementId) {
if (elementId == KeyboardId.ELEMENT_ALPHABET_AUTOMATIC_SHIFTED) { if (elementId == KeyboardId.ELEMENT_ALPHABET_AUTOMATIC_SHIFTED) {
return getCommonAlphabetLayout(isPhone); return getCommonAlphabetLayout(isPhone);
} }
final ExpectedKeyboardBuilder builder = new ExpectedKeyboardBuilder( return ALPHABET_SHIFTED_COMMON;
ALPHABET_SHIFTED_COMMON);
if (isPhone) {
builder.addKeysOnTheRightOfRow(3,
// U+0902: "ं" DEVANAGARI SIGN ANUSVARA
key(SIGN_ANUSVARA, "\u0902"),
// U+0919: "ङ" DEVANAGARI LETTER NGA
"\u0919",
// U+0948: "ै" DEVANAGARI VOWEL SIGN AI
// U+0936/U+094D/U+0930:
// "श्र" DEVANAGARI LETTER SHA/DEVANAGARI SIGN VIRAMA/DEVANAGARI LETTER RA
key(VOWEL_SIGN_AI, "\u0948", moreKey("\u0936\u094D\u0930")));
} else {
builder.addKeysOnTheRightOfRow(3,
// U+0902: "ं" DEVANAGARI SIGN ANUSVARA
key(SIGN_ANUSVARA, "\u0902"),
// U+0919: "ङ" DEVANAGARI LETTER NGA
"\u0919",
// U+0948: "ै" DEVANAGARI VOWEL SIGN AI
// U+0936/U+094D/U+0930:
// "श्र" DEVANAGARI LETTER SHA/DEVANAGARI SIGN VIRAMA/DEVANAGARI LETTER RA
key(VOWEL_SIGN_AI, "\u0948", moreKey("\u0936\u094D\u0930")),
// U+0930/U+0941: "रु" DEVANAGARI LETTER RA/DEVANAGARI VOWEL SIGN U
key("\u0930\u0941", moreKey("!")),
"?");
}
return builder.build();
} }
private static final ExpectedKey[][] ALPHABET_COMMON = new ExpectedKeyboardBuilder() private static final ExpectedKey[][] ALPHABET_COMMON = new ExpectedKeyboardBuilder()
...@@ -181,7 +119,17 @@ public final class NepaliTraditional extends LayoutBase { ...@@ -181,7 +119,17 @@ public final class NepaliTraditional extends LayoutBase {
// U+0916: "ख" DEVANAGARI LETTER KHA // U+0916: "ख" DEVANAGARI LETTER KHA
// U+0926: "द" DEVANAGARI LETTER DA // U+0926: "द" DEVANAGARI LETTER DA
// U+0932: "ल" DEVANAGARI LETTER LA // U+0932: "ल" DEVANAGARI LETTER LA
"\u0936", "\u0939", "\u0905", "\u0916", "\u0926", "\u0932") "\u0936", "\u0939", "\u0905", "\u0916", "\u0926", "\u0932",
// U+0947: "े" DEVANAGARI VOWEL SIGN E
// U+0903: "ः‍" DEVANAGARI SIGN VISARGA
// U+093D: "ऽ" DEVANAGARI SIGN AVAGRAHA
key(VOWEL_SIGN_E, "\u0947", joinMoreKeys(
moreKey(SIGN_VISARGA, "\u0903"), "\u093D")),
// U+094D: "्" DEVANAGARI SIGN VIRAMA
key(SIGN_VIRAMA, "\u094D"),
// U+0930: "र" DEVANAGARI LETTER RA
// U+0930/U+0941: "रु" DEVANAGARI LETTER RA/DEVANAGARI VOWEL SIGN U
key("\u0930", moreKey("\u0930\u0941")))
.build(); .build();
private static final ExpectedKey[][] ALPHABET_SHIFTED_COMMON = new ExpectedKeyboardBuilder() private static final ExpectedKey[][] ALPHABET_SHIFTED_COMMON = new ExpectedKeyboardBuilder()
...@@ -264,6 +212,14 @@ public final class NepaliTraditional extends LayoutBase { ...@@ -264,6 +212,14 @@ public final class NepaliTraditional extends LayoutBase {
key(VOWEL_SIGN_AU, "\u094C"), 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
"\u0926\u094D\u092F") "\u0926\u094D\u092F",
// U+0902: "ं" DEVANAGARI SIGN ANUSVARA
key(SIGN_ANUSVARA, "\u0902"),
// U+0919: "ङ" DEVANAGARI LETTER NGA
"\u0919",
// U+0948: "ै" DEVANAGARI VOWEL SIGN AI
// U+0936/U+094D/U+0930:
// "श्र" DEVANAGARI LETTER SHA/DEVANAGARI SIGN VIRAMA/DEVANAGARI LETTER RA
key(VOWEL_SIGN_AI, "\u0948", moreKey("\u0936\u094D\u0930")))
.build(); .build();
} }
...@@ -38,8 +38,30 @@ public class NepaliCustomizer extends DevanagariCustomizer { ...@@ -38,8 +38,30 @@ public class NepaliCustomizer extends DevanagariCustomizer {
return joinKeys(LANGUAGE_SWITCH_KEY, SPACE_KEY, key(ZWNJ_KEY, ZWJ_KEY)); return joinKeys(LANGUAGE_SWITCH_KEY, SPACE_KEY, key(ZWNJ_KEY, ZWJ_KEY));
} }
@Override
public ExpectedKey[] getKeysRightToSpacebar(final boolean isPhone) {
// U+0964: "।" DEVANAGARI DANDA
final ExpectedKey periodKey = key("\u0964", getPunctuationMoreKeys(isPhone));
return joinKeys(periodKey);
}
@Override
public ExpectedKey[] getPunctuationMoreKeys(final boolean isPhone) {
return isPhone ? NEPALI_PHONE_PUNCTUATION_MORE_KEYS
: NEPALI_TABLET_PUNCTUATION_MORE_KEYS;
}
// U+0930/U+0941/U+002E "रु." NEPALESE RUPEE SIGN // U+0930/U+0941/U+002E "रु." NEPALESE RUPEE SIGN
private static final ExpectedKey CURRENCY_NEPALI = key("\u0930\u0941\u002E", private static final ExpectedKey CURRENCY_NEPALI = key("\u0930\u0941\u002E",
Symbols.DOLLAR_SIGN, Symbols.CENT_SIGN, Symbols.EURO_SIGN, Symbols.POUND_SIGN, Symbols.DOLLAR_SIGN, Symbols.CENT_SIGN, Symbols.EURO_SIGN, Symbols.POUND_SIGN,
Symbols.YEN_SIGN, Symbols.PESO_SIGN); Symbols.YEN_SIGN, Symbols.PESO_SIGN);
// Punctuation more keys for phone form factor.
private static final ExpectedKey[] NEPALI_PHONE_PUNCTUATION_MORE_KEYS = joinKeys(
".", ",", "?", "!", "#", ")", "(", "/", ";",
"'", "@", ":", "-", "\"", "+", "%", "&");
// Punctuation more keys for tablet form factor.
private static final ExpectedKey[] NEPALI_TABLET_PUNCTUATION_MORE_KEYS = joinKeys(
".", ",", "'", "#", ")", "(", "/", ";",
"@", ":", "-", "\"", "+", "%", "&");
} }
...@@ -57,4 +57,9 @@ ...@@ -57,4 +57,9 @@
<string name="additional_morekeys_symbols_0">0</string> <string name="additional_morekeys_symbols_0">0</string>
<!-- U+0930/U+0941/U+002E "रु." NEPALESE RUPEE SIGN --> <!-- U+0930/U+0941/U+002E "रु." NEPALESE RUPEE SIGN -->
<string name="keyspec_currency">&#x0930;&#x0941;&#x002E;</string> <string name="keyspec_currency">&#x0930;&#x0941;&#x002E;</string>
<!-- U+0964: "।" DEVANAGARI DANDA -->
<string name="keyspec_period">&#x0964;</string>
<string name="keyspec_tablet_period">&#x0964;</string>
<string name="morekeys_period">"!autoColumnOrder!9,.,\\,,?,!,#,),(,/,;,',@,:,-,\",+,\\%,&amp;"</string>
<string name="morekeys_tablet_period">"!autoColumnOrder!8,.,\\,,',#,),(,/,;,@,:,-,\",+,\\%,&amp;"</string>
</resources> </resources>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment