Skip to content

Commit

Permalink
first attempts to update and introduce all intended layout variants
Browse files Browse the repository at this point in the history
  • Loading branch information
Yaksinikos committed Jul 12, 2024
1 parent e36ccdd commit 21c63c8
Show file tree
Hide file tree
Showing 28 changed files with 467 additions and 204 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ public class ScriptUtils {
public static final int SCRIPT_TELUGU = 16;
public static final int SCRIPT_THAI = 17;
public static final int SCRIPT_BULGARIAN = 18;
public static final int SCRIPT_GLAGOLITIC = 19;


public static final String LANGUAGE_GEORGIAN = "ka";

Expand Down Expand Up @@ -77,6 +79,7 @@ public class ScriptUtils {
mLanguageCodeToScriptCode.put("te", SCRIPT_TELUGU);
mLanguageCodeToScriptCode.put("th", SCRIPT_THAI);
mLanguageCodeToScriptCode.put("uk", SCRIPT_CYRILLIC);
mLanguageCodeToScriptCode.put("hr", SCRIPT_GLAGOLITIC);

NON_UPPERCASE_SCRIPTS.add(LANGUAGE_GEORGIAN);
}
Expand Down Expand Up @@ -123,6 +126,12 @@ public static boolean isLetterPartOfScript(final int codePoint, final int script
// Unicode range, but they are archaic characters that are not used in modern
// Russian and are not used by our dictionary.
return codePoint >= 0x400 && codePoint <= 0x52F && Character.isLetter(codePoint);
case SCRIPT_GLAGOLITIC:
// U+2C00-U+2C5F & U+1E001-U+1E006, U+1E008-U+1E00F, U+1E010-U+1E018, U+1E01B-U+1E01F, U+1E020-U+1E021, U+1E023-U+1E024, U+1E026-U+1E02A
// aprx. U+2C00-U+2C5F & U+1E000-U+1E02F
// The Unicode block for Glagolitic is U+2C00–U+2C5F.
// The Glagolitic combining letters for Glagolitic Supplement block (U+1E000–U+1E02F) was added to the Unicode Standard in June, 2016 with the release of version 9.0
return (codePoint >= 0x2C00 && codePoint <= 0x2C5F || codePoint >= 0x1E000 && codePoint <= 0x1E02F);
case SCRIPT_DEVANAGARI:
// Devanagari unicode block is +0900..U+097F
return (codePoint >= 0x900 && codePoint <= 0x97F);
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@
<enum name="tamil" value="15" />
<enum name="telugu" value="16" />
<enum name="thai" value="17" />
<enum name="glagolitic" value="19" />
</attr>
</declare-styleable>

Expand Down
26 changes: 26 additions & 0 deletions app/src/main/res/xml/kbd_slavonic_cyrillic.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2012, 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-auto"
>
<include
latin:keyboardLayout="@xml/rows_slavonic_cyrillic" />
</Keyboard>
26 changes: 26 additions & 0 deletions app/src/main/res/xml/kbd_slavonic_glagolitic.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2012, 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-auto"
>
<include
latin:keyboardLayout="@xml/rows_slavonic_glagolitic" />
</Keyboard>
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@
xmlns:latin="http://schemas.android.com/apk/res-auto"
>
<include
latin:keyboardLayout="@xml/rows_slavonic" />
latin:keyboardLayout="@xml/rows_slavonic_latin" />
</Keyboard>
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@

<KeyboardLayoutSet xmlns:latin="http://schemas.android.com/apk/res-auto">
<Feature latin:supportedScript="cyrillic" />
<!-- TODO <Feature latin:supportedScript="glagolitic" />-->

<Element
latin:elementKeyboard="@xml/kbd_slavonic"
latin:elementKeyboard="@xml/kbd_slavonic_cyrillic"
latin:elementName="alphabet"
latin:enableProximityCharsCorrection="true" />
<Element
Expand Down
42 changes: 42 additions & 0 deletions app/src/main/res/xml/keyboard_layout_set_slavonic_glagolitic.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?><!--
/*
**
** Copyright 2012, 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-auto">
<Feature latin:supportedScript="glagolitic" />

<Element
latin:elementKeyboard="@xml/kbd_slavonic_glagolitic"
latin:elementName="alphabet"
latin:enableProximityCharsCorrection="true" />
<Element
latin:elementKeyboard="@xml/kbd_symbols"
latin:elementName="symbols" />
<Element
latin:elementKeyboard="@xml/kbd_symbols_shift"
latin:elementName="symbolsShifted" />
<Element
latin:elementKeyboard="@xml/kbd_phone"
latin:elementName="phone" />
<Element
latin:elementKeyboard="@xml/kbd_phone_symbols"
latin:elementName="phoneSymbols" />
<Element
latin:elementKeyboard="@xml/kbd_number"
latin:elementName="number" />
</KeyboardLayoutSet>
42 changes: 42 additions & 0 deletions app/src/main/res/xml/keyboard_layout_set_slavonic_latin.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?><!--
/*
**
** Copyright 2012, 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-auto">
<Feature latin:supportedScript="latin" />

<Element
latin:elementKeyboard="@xml/kbd_slavonic_latin"
latin:elementName="alphabet"
latin:enableProximityCharsCorrection="true" />
<Element
latin:elementKeyboard="@xml/kbd_symbols"
latin:elementName="symbols" />
<Element
latin:elementKeyboard="@xml/kbd_symbols_shift"
latin:elementName="symbolsShifted" />
<Element
latin:elementKeyboard="@xml/kbd_phone"
latin:elementName="phone" />
<Element
latin:elementKeyboard="@xml/kbd_phone_symbols"
latin:elementName="phoneSymbols" />
<Element
latin:elementKeyboard="@xml/kbd_number"
latin:elementName="number" />
</KeyboardLayoutSet>
26 changes: 14 additions & 12 deletions app/src/main/res/xml/method.xml
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,7 @@
android:imeSubtypeExtraValue="KeyboardLayoutSet=qwerty,AsciiCapable,EmojiCapable"
android:isAsciiCapable="true"
/>
<!--
<subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_generic"
android:subtypeId="0x8ea3eb01"
Expand Down Expand Up @@ -823,52 +824,53 @@
android:imeSubtypeExtraValue="KeyboardLayoutSet=slavonic,SupportTouchPositionCorrection,EmojiCapable"
android:isAsciiCapable="true"
/>
-->
<subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_generic"
android:subtypeId="0x8ea3eb13"
android:imeSubtypeLocale="sla_BGBDS"
android:imeSubtypeLocale="sla_bgbds"
android:imeSubtypeMode="keyboard"
android:imeSubtypeExtraValue="KeyboardLayoutSet=slavonic,SupportTouchPositionCorrection,EmojiCapable"
android:imeSubtypeExtraValue="KeyboardLayoutSet=slavonic_cyrillic,SupportTouchPositionCorrection,EmojiCapable"
android:isAsciiCapable="false"
/>
<subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_generic"
android:subtypeId="0x8ea3eb14"
android:imeSubtypeLocale="sla_CyrlE1"
android:imeSubtypeLocale="sla_cyrle1"
android:imeSubtypeMode="keyboard"
android:imeSubtypeExtraValue="KeyboardLayoutSet=slavonic,SupportTouchPositionCorrection,EmojiCapable"
android:imeSubtypeExtraValue="KeyboardLayoutSet=slavonic_cyrillic,SupportTouchPositionCorrection,EmojiCapable"
android:isAsciiCapable="false"
/>
<subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_generic"
android:subtypeId="0x8ea3eb15"
android:imeSubtypeLocale="sla_CyrsUcouke"
android:imeSubtypeLocale="sla_cyrsucouke"
android:imeSubtypeMode="keyboard"
android:imeSubtypeExtraValue="KeyboardLayoutSet=slavonic,SupportTouchPositionCorrection,EmojiCapable"
android:imeSubtypeExtraValue="KeyboardLayoutSet=slavonic_cyrillic,SupportTouchPositionCorrection,EmojiCapable"
android:isAsciiCapable="false"
/>
<subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_generic"
android:subtypeId="0x8ea3eb16"
android:imeSubtypeLocale="sla_GlagUcouke"
android:imeSubtypeLocale="sla_glagucouke"
android:imeSubtypeMode="keyboard"
android:imeSubtypeExtraValue="KeyboardLayoutSet=slavonic,SupportTouchPositionCorrection,EmojiCapable"
android:imeSubtypeExtraValue="KeyboardLayoutSet=slavonic_glagolitic,SupportTouchPositionCorrection,EmojiCapable"
android:isAsciiCapable="false"
/>
<subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_generic"
android:subtypeId="0x8ea3eb17"
android:imeSubtypeLocale="sla_GlagE1"
android:imeSubtypeLocale="sla_glage1"
android:imeSubtypeMode="keyboard"
android:imeSubtypeExtraValue="KeyboardLayoutSet=slavonic,SupportTouchPositionCorrection,EmojiCapable"
android:imeSubtypeExtraValue="KeyboardLayoutSet=slavonic_glagolitic,SupportTouchPositionCorrection,EmojiCapable"
android:isAsciiCapable="false"
/>
<subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_generic"
android:subtypeId="0x8ea3eb18"
android:imeSubtypeLocale="sla_LatnE1"
android:imeSubtypeLocale="sla_latne1"
android:imeSubtypeMode="keyboard"
android:imeSubtypeExtraValue="KeyboardLayoutSet=slavonic,SupportTouchPositionCorrection,EmojiCapable"
android:imeSubtypeExtraValue="KeyboardLayoutSet=slavonic_latin,SupportTouchPositionCorrection,EmojiCapable"
android:isAsciiCapable="true"
/>
<subtype android:icon="@drawable/ic_ime_switcher_dark"
Expand Down
24 changes: 12 additions & 12 deletions app/src/main/res/xml/rowkeys_slavonic_bgbds1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,57 +20,57 @@
<merge xmlns:latin="http://schemas.android.com/apk/res-auto">
<!-- U+046B: "ѫ" CYRILLIC LETTER ǔ -->
<Key
latin:additionalMoreKeys="1,ⱖ,ѭ,ⱙ,ԛ,ⷾ,ⷿ"
latin:additionalMoreKeys="1,ⱖ,ѭ,ⱙ,ԛ,ⷾ,ⷿ,&#x1E026;,&#x1E029;"
latin:keyHintLabel="1"
latin:keySpec="&#x046B;" />
<!-- U+0443: "у" CYRILLIC LETTER SHORT ou -->
<Key
latin:additionalMoreKeys="2,ⱆ,ю,ⱘ,ꙋ,ⱓ,ⷹ,ⷻ,ꙷ"
latin:additionalMoreKeys="2,ⱆ,ю,ⱘ,ꙋ,ⱓ,ⷹ,ⷻ,ꙷ,&#x1E016;,&#x1E023;,&#x1E028;"
latin:keyHintLabel="2"
latin:keySpec="&#x0443;" />
<!-- U+0435: "е" CYRILLIC LETTER e -->
<Key
latin:additionalMoreKeys="3,ё,ⰵ,ѥ,ⱗ,э,є,ꙴ,ⷷ,ꚟ"
latin:additionalMoreKeys="3,ё,ⰵ,ѥ,ⱗ,э,є,ꙴ,ⷷ,ꚟ,&#x1E005;,&#x1E027;"
latin:keyHintLabel="3"
latin:keySpec="&#x0435;" />
<!-- U+0438: "и" CYRILLIC LETTER ĩ -->
<Key
latin:additionalMoreKeys="4,ⰻ,й,ⰺ,ꙵ"
latin:additionalMoreKeys="4,ⰻ,й,ⰺ,ꙵ&#x1E00B;,&#x1E00A;"
latin:keyHintLabel="4"
latin:keySpec="&#x0438;" />
<!-- U+0448: "ш" CYRILLIC LETTER š -->
<Key
latin:additionalMoreKeys="5,ⱎ,щ,ⱋ,ⷲ,ⷳ"
latin:additionalMoreKeys="5,ⱎ,щ,ⱋ,ⷲ,ⷳ,&#x1E01E;,&#x1E01B;"
latin:keyHintLabel="5"
latin:keySpec="&#x0448;" />
<!-- U+043A: "к" CYRILLIC LETTER k -->
<Key
latin:additionalMoreKeys="6,ⰽ,ⷦ"
latin:additionalMoreKeys="6,ⰽ,ⷦ,&#x1E00D;"
latin:keyHintLabel="6"
latin:keySpec="&#x043A;" />
<!-- U+0441: "с" CYRILLIC LETTER s -->
<Key
latin:additionalMoreKeys="7,ⱄ,ѕ,ⷭ"
latin:additionalMoreKeys="7,ⱄ,ѕ,ⷭ,&#x1E014;"
latin:keyHintLabel="7"
latin:keySpec="&#x0441;" />
<!-- U+0434: "д" CYRILLIC LETTER l -->
<!-- U+0434: "д" CYRILLIC LETTER d -->
<Key
latin:additionalMoreKeys="8,+,ⰴ,ђ,ⰼ,ⷣ"
latin:additionalMoreKeys="8,+,ⰴ,ђ,ⰼ,ⷣ,&#x1E004;,&#x1E00C;"
latin:keyHintLabel="8"
latin:keySpec="&#x0434;" />
<!-- U+0437: "з" CYRILLIC LETTER z -->
<Key
latin:additionalMoreKeys="9,ⰸ,ѯ,ⰷ,ꙁ,ꙃ,ⷥ"
latin:additionalMoreKeys="9,ⰸ,ѯ,ⰷ,ꙁ,ꙃ,ⷥ,&#x1E008;"
latin:keyHintLabel="9"
latin:keySpec="&#x0437;" />
<!-- U+0446: "ц" CYRILLIC LETTER c -->
<Key
latin:additionalMoreKeys="0,ⱌ,ҁ,ⷰ"
latin:additionalMoreKeys="0,ⱌ,ҁ,ⷰ,&#x1E01C;"
latin:keyHintLabel="0"
latin:keySpec="&#x0446;" />
<!-- U+0431: "б" CYRILLIC LETTER b -->
<Key
latin:additionalMoreKeys="×,ⰱ,ⷠ"
latin:additionalMoreKeys="×,ⰱ,ⷠ,&#x1E001;"
latin:keyHintLabel="×"
latin:keySpec="&#x0431;" />
</merge>
Loading

0 comments on commit 21c63c8

Please sign in to comment.