Skip to content

Commit

Permalink
add Arabic PC layout
Browse files Browse the repository at this point in the history
  • Loading branch information
dslul committed Oct 24, 2020
1 parent 1c67a85 commit dc46c14
Show file tree
Hide file tree
Showing 10 changed files with 350 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ android {
applicationId "org.dslul.openboard.inputmethod.latin"
minSdkVersion 19
targetSdkVersion 30
versionCode 13
versionCode 14
versionName '1.4.2'
}

Expand Down
3 changes: 3 additions & 0 deletions app/src/main/res/values/donottranslate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@
<!-- Description for Bulgarian (BEKL) subtype. -->
<string name="subtype_bulgarian_bekl" translatable="false">%s (BEKL)</string>

<!-- Description for Arabic (PC) subtype. -->
<string name="subtype_arabic_pc" translatable="false">%s (PC)</string>

<!-- Compatibility map from subtypeLocale:subtypeExtraValue to keyboardLayoutSet -->
<string-array name="locale_and_extra_value_to_keyboard_layout_set_map">
<item>en_US:TrySuppressingImeSwitcher,AsciiCapable,SupportTouchPositionCorrection,EmojiCapable</item>
Expand Down
48 changes: 48 additions & 0 deletions app/src/main/res/xml-sw600dp/rows_arabic_pc.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2011, 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-auto">
<include latin:keyboardLayout="@xml/key_styles_common" />
<Row
latin:keyWidth="9%p"
latin:keyLabelFlags="fontNormal"
>
<include latin:keyboardLayout="@xml/rowkeys_arabic1_pc" />
<Key
latin:keyStyle="deleteKeyStyle"
latin:keyWidth="fillRight" />
</Row>
<Row
latin:keyWidth="9%p"
latin:keyLabelFlags="fontNormal"
>
<include latin:keyboardLayout="@xml/rowkeys_arabic2_pc" />
<Key
latin:keyStyle="enterKeyStyle"
latin:keyWidth="fillRight" />
</Row>
<Row
latin:keyWidth="9%p"
latin:keyLabelFlags="fontNormal"
>
<include latin:keyboardLayout="@xml/rowkeys_arabic3_pc" />
</Row>
<include latin:keyboardLayout="@xml/row_qwerty4" />
</merge>
26 changes: 26 additions & 0 deletions app/src/main/res/xml/kbd_arabic_pc.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2011, 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_arabic_pc" />
</Keyboard>
44 changes: 44 additions & 0 deletions app/src/main/res/xml/keyboard_layout_set_arabic_pc.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?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="arabic" />
<Element
latin:elementName="alphabet"
latin:elementKeyboard="@xml/kbd_arabic_pc"
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>
9 changes: 9 additions & 0 deletions app/src/main/res/xml/method.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
keyboard_locale: script_name/keyboard_layout_set
af: Afrikaans/qwerty
ar: Arabic/arabic
ar: Arabic/arabic_pc
az_AZ: Azerbaijani (Azerbaijan)/qwerty
be_BY: Belarusian (Belarus)/east_slavic
bg: Bulgarian/bulgarian
Expand Down Expand Up @@ -161,6 +162,14 @@
android:imeSubtypeExtraValue="SupportTouchPositionCorrection,EmojiCapable"
android:isAsciiCapable="false"
/>
<subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_arabic_pc"
android:subtypeId="0x590dde41"
android:imeSubtypeLocale="ar"
android:imeSubtypeMode="keyboard"
android:imeSubtypeExtraValue="KeyboardLayoutSet=arabic_pc,EmojiCapable"
android:isAsciiCapable="false"
/>
<subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_generic"
android:subtypeId="0x70b0f974"
Expand Down
78 changes: 78 additions & 0 deletions app/src/main/res/xml/rowkeys_arabic1_pc.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="utf-8"?>

<merge xmlns:latin="http://schemas.android.com/apk/res-auto">
<!-- U+0636: "ض" ARABIC LETTER DAD
U+0661: "١" ARABIC-INDIC DIGIT ONE -->
<Key
latin:keySpec="&#x0636;"
latin:keyHintLabel="1"
latin:additionalMoreKeys="1,&#x0661;" />
<!-- U+0635: "ص" ARABIC LETTER SAD
U+0662: "٢" ARABIC-INDIC DIGIT TWO -->
<Key
latin:keySpec="&#x0635;"
latin:keyHintLabel="2"
latin:additionalMoreKeys="2,&#x0662;" />
<!-- U+0642: "ق" ARABIC LETTER QAF
U+0663: "٣" ARABIC-INDIC DIGIT THREE
U+06A8: "ڨ" ARABIC LETTER QAF WITH THREE DOTS ABOVE -->
<!-- TODO: DroidSansArabic lacks the glyph of U+06A8 ARABIC LETTER QAF WITH THREE DOTS ABOVE -->
<Key
latin:keySpec="&#x0642;"
latin:keyHintLabel="3"
latin:additionalMoreKeys="3,&#x0663;"
latin:moreKeys="&#x06A8;" />
<!-- U+0641: "ف" ARABIC LETTER FEH
U+0664: "٤" ARABIC-INDIC DIGIT FOUR
U+06A4: "ڤ" ARABIC LETTER VEH
U+06A2: "ڢ" ARABIC LETTER FEH WITH DOT MOVED BELOW
U+06A5: "ڥ" ARABIC LETTER FEH WITH THREE DOTS BELOW -->
<!-- TODO: DroidSansArabic lacks the glyph of U+06A2 ARABIC LETTER FEH WITH DOT MOVED BELOW -->
<!-- TODO: DroidSansArabic lacks the glyph of U+06A5 ARABIC LETTER FEH WITH THREE DOTS BELOW -->
<Key
latin:keySpec="&#x0641;"
latin:keyHintLabel="4"
latin:additionalMoreKeys="4,&#x0664;"
latin:moreKeys="&#x06A4;,&#x06A2;,&#x06A5;" />
<!-- U+063A: "غ" ARABIC LETTER GHAIN
U+0665: "٥" ARABIC-INDIC DIGIT FIVE -->
<Key
latin:keySpec="&#x063A;"
latin:keyHintLabel="5"
latin:additionalMoreKeys="5,&#x0665;" />
<!-- U+0639: "ع" ARABIC LETTER AIN
U+0666: "٦" ARABIC-INDIC DIGIT SIX -->
<Key
latin:keySpec="&#x0639;"
latin:keyHintLabel="6"
latin:additionalMoreKeys="6,&#x0666;" />
<!-- U+0647: "ه" ARABIC LETTER HEH
U+0667: "٧" ARABIC-INDIC DIGIT SEVEN
U+FEEB: "ﻫ" ARABIC LETTER HEH INITIAL FORM
U+0647 U+200D: ARABIC LETTER HEH + ZERO WIDTH JOINER -->
<Key
latin:keySpec="&#x0647;"
latin:keyHintLabel="7"
latin:additionalMoreKeys="7,&#x0667;"
latin:moreKeys="&#xFEEB;|&#x0647;&#x200D;" />
<!-- U+062E: "خ" ARABIC LETTER KHAH
U+0668: "٨" ARABIC-INDIC DIGIT EIGHT -->
<Key
latin:keySpec="&#x062E;"
latin:keyHintLabel="8"
latin:additionalMoreKeys="8,&#x0668;" />
<!-- U+062D: "ح" ARABIC LETTER HAH
U+0669: "٩" ARABIC-INDIC DIGIT NINE -->
<Key
latin:keySpec="&#x062D;"
latin:keyHintLabel="9"
latin:additionalMoreKeys="9,&#x0669;" />
<!-- U+062C: "ج" ARABIC LETTER JEEM
U+0660: "٠" ARABIC-INDIC DIGIT ZERO
U+0686: "چ" ARABIC LETTER TCHEH -->
<Key
latin:keySpec="&#x062C;"
latin:keyHintLabel="0"
latin:additionalMoreKeys="0,&#x0660;"
latin:moreKeys="&#x0686;" />
</merge>
56 changes: 56 additions & 0 deletions app/src/main/res/xml/rowkeys_arabic2_pc.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>

<merge xmlns:latin="http://schemas.android.com/apk/res-auto">
<!-- U+0634: "ش" ARABIC LETTER SHEEN
U+069C: "ڜ" ARABIC LETTER SEEN WITH THREE DOTS BELOW AND THREE DOTS ABOVE -->
<!-- TODO: DroidSansArabic lacks the glyph of U+069C ARABIC LETTER SEEN WITH THREE DOTS BELOW AND THREE DOTS ABOVE -->
<Key
latin:keySpec="&#x0634;"
latin:moreKeys="&#x069C;" />
<!-- U+0633: "س" ARABIC LETTER SEEN -->
<Key latin:keySpec="&#x0633;" />
<!-- U+064A: "ي" ARABIC LETTER YEH
U+0626: "ئ" ARABIC LETTER YEH WITH HAMZA ABOVE
U+0649: "ى" ARABIC LETTER ALEF MAKSURA -->
<Key
latin:keySpec="&#x064A;"
latin:moreKeys="&#x0626;,&#x0649;" />
<!-- U+0628: "ب" ARABIC LETTER BEH
U+067E: "پ" ARABIC LETTER PEH -->
<Key
latin:keySpec="&#x0628;"
latin:moreKeys="&#x067E;" />
<!-- U+0644: "ل" ARABIC LETTER LAM
U+FEFB: "ﻻ" ARABIC LIGATURE LAM WITH ALEF ISOLATED FORM
U+0627: "ا" ARABIC LETTER ALEF
U+FEF7: "ﻷ" ARABIC LIGATURE LAM WITH ALEF WITH HAMZA ABOVE ISOLATED FORM
U+0623: "أ" ARABIC LETTER ALEF WITH HAMZA ABOVE
U+FEF9: "ﻹ" ARABIC LIGATURE LAM WITH ALEF WITH HAMZA BELOW ISOLATED FORM
U+0625: "إ" ARABIC LETTER ALEF WITH HAMZA BELOW
U+FEF5: "ﻵ" ARABIC LIGATURE LAM WITH ALEF WITH MADDA ABOVE ISOLATED FORM
U+0622: "آ" ARABIC LETTER ALEF WITH MADDA ABOVE -->
<Key
latin:keySpec="&#x0644;"
latin:moreKeys="&#xFEFB;|&#x0644;&#x0627;,&#xFEF7;|&#x0644;&#x0623;,&#xFEF9;|&#x0644;&#x0625;,&#xFEF5;|&#x0644;&#x0622;" />
<!-- U+0627: "ا" ARABIC LETTER ALEF
U+0622: "آ" ARABIC LETTER ALEF WITH MADDA ABOVE
U+0621: "ء" ARABIC LETTER HAMZA
U+0623: "أ" ARABIC LETTER ALEF WITH HAMZA ABOVE
U+0625: "إ" ARABIC LETTER ALEF WITH HAMZA BELOW
U+0671: "ٱ" ARABIC LETTER ALEF WASLA -->
<Key
latin:keySpec="&#x0627;"
latin:moreKeys="!fixedColumnOrder!5,&#x0622;,&#x0621;,&#x0623;,&#x0625;,&#x0671;" />
<!-- U+062A: "ت" ARABIC LETTER TEH -->
<Key latin:keySpec="&#x062A;" />
<!-- U+0646: "ن" ARABIC LETTER NOON -->
<Key latin:keySpec="&#x0646;" />
<!-- U+0645: "م" ARABIC LETTER MEEM -->
<Key latin:keySpec="&#x0645;" />
<!-- U+0643: "ك" ARABIC LETTER KAF
U+06AF: "گ" ARABIC LETTER GAF
U+06A9: "ک" ARABIC LETTER KEHEH -->
<Key
latin:keySpec="&#x0643;"
latin:moreKeys="&#x06AF;,&#x06A9;" />
</merge>
28 changes: 28 additions & 0 deletions app/src/main/res/xml/rowkeys_arabic3_pc.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>

<merge xmlns:latin="http://schemas.android.com/apk/res-auto">
<!-- U+0638: "ظ" ARABIC LETTER ZAH -->
<Key latin:keySpec="&#x0638;" />
<!-- U+0637: "ط" ARABIC LETTER TAH -->
<Key latin:keySpec="&#x0637;" />
<!-- U+0630: "ذ" ARABIC LETTER THAL -->
<Key latin:keySpec="&#x0630;" />
<!-- U+062F: "د" ARABIC LETTER DAL -->
<Key latin:keySpec="&#x062F;" />
<!-- U+0632: "ز" ARABIC LETTER ZAIN
U+0698: "ژ" ARABIC LETTER JEH -->
<Key
latin:keySpec="&#x0632;"
latin:moreKeys="&#x0698;" />
<!-- U+0631: "ر" ARABIC LETTER REH -->
<Key latin:keySpec="&#x0631;" />
<!-- U+0648: "و" ARABIC LETTER WAW
U+0624: "ؤ" ARABIC LETTER WAW WITH HAMZA ABOVE -->
<Key
latin:keySpec="&#x0648;"
latin:moreKeys="&#x0624;" />
<!-- U+0629: "ة" ARABIC LETTER TEH MARBUTA -->
<Key latin:keySpec="&#x0629;" />
<!-- U+062B: "ث" ARABIC LETTER THEH -->
<Key latin:keySpec="&#x062B;" />
</merge>
57 changes: 57 additions & 0 deletions app/src/main/res/xml/rows_arabic_pc.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2011, 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-auto">
<include latin:keyboardLayout="@xml/key_styles_common" />
<switch>
<case
latin:numberRowEnabled="true"
>
<Row
latin:keyWidth="10%p"
>
<include
latin:keyboardLayout="@xml/rowkeys_symbols1" />
</Row>
</case>
</switch>
<Row
latin:keyWidth="10%p"
latin:keyLabelFlags="fontNormal"
>
<include latin:keyboardLayout="@xml/rowkeys_arabic1_pc" />
</Row>
<Row
latin:keyWidth="10%p"
latin:keyLabelFlags="fontNormal"
>
<include latin:keyboardLayout="@xml/rowkeys_arabic2_pc" />
</Row>
<Row
latin:keyWidth="10%p"
latin:keyLabelFlags="fontNormal"
>
<include latin:keyboardLayout="@xml/rowkeys_arabic3_pc" />
<Key
latin:keyStyle="deleteKeyStyle"
latin:keyWidth="fillRight" />
</Row>
<include latin:keyboardLayout="@xml/row_qwerty4" />
</merge>

0 comments on commit dc46c14

Please sign in to comment.