Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Belarusan Cyrillic and Latin layouts #70

Merged
merged 16 commits into from
Oct 25, 2024
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ import org.fossify.keyboard.databases.ClipsDatabase
import org.fossify.keyboard.helpers.Config
import org.fossify.keyboard.helpers.INPUT_METHOD_SUBTYPE_VOICE
import org.fossify.keyboard.helpers.LANGUAGE_ARABIC
import org.fossify.keyboard.helpers.LANGUAGE_BELARUSIAN_CYRL
import org.fossify.keyboard.helpers.LANGUAGE_BELARUSIAN_LATN
import org.fossify.keyboard.helpers.LANGUAGE_BENGALI
import org.fossify.keyboard.helpers.LANGUAGE_BULGARIAN
import org.fossify.keyboard.helpers.LANGUAGE_CENTRAL_KURDISH
Expand Down Expand Up @@ -268,6 +270,8 @@ fun Context.getKeyboardLanguagesRadioItems(): ArrayList<RadioItem> {
fun Context.getKeyboardLanguageText(language: Int): String {
return when (language) {
LANGUAGE_ARABIC -> getString(R.string.translation_arabic)
LANGUAGE_BELARUSIAN_CYRL -> "${getString(R.string.translation_belarusian)} (Cyrillic)"
LANGUAGE_BELARUSIAN_LATN -> "${getString(R.string.translation_belarusian)} (Latin)"
LANGUAGE_BENGALI -> getString(R.string.translation_bengali)
LANGUAGE_BULGARIAN -> getString(R.string.translation_bulgarian)
LANGUAGE_CENTRAL_KURDISH -> getString(R.string.translation_central_kurdish)
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/kotlin/org/fossify/keyboard/helpers/Constants.kt
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,14 @@ const val LANGUAGE_ESPERANTO = 23
const val LANGUAGE_HEBREW = 24
const val LANGUAGE_ARABIC = 25
const val LANGUAGE_CENTRAL_KURDISH = 26
const val LANGUAGE_BELARUSIAN_CYRL = 27
const val LANGUAGE_BELARUSIAN_LATN = 28

// Keep this sorted
val SUPPORTED_LANGUAGES = listOf(
LANGUAGE_ARABIC,
LANGUAGE_BELARUSIAN_CYRL,
LANGUAGE_BELARUSIAN_LATN,
LANGUAGE_BENGALI,
LANGUAGE_BULGARIAN,
LANGUAGE_CENTRAL_KURDISH,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,8 @@ class SimpleKeyboardIME : InputMethodService(), OnKeyboardActionListener, Shared
private fun getKeyboardLayoutXML(): Int {
return when (baseContext.config.keyboardLanguage) {
LANGUAGE_ARABIC -> R.xml.keys_letters_arabic
LANGUAGE_BELARUSIAN_CYRL -> R.xml.keys_letters_belarusian_cyrl
LANGUAGE_BELARUSIAN_LATN -> R.xml.keys_letters_belarusian_latn
LANGUAGE_BENGALI -> R.xml.keys_letters_bengali
LANGUAGE_BULGARIAN -> R.xml.keys_letters_bulgarian
LANGUAGE_CENTRAL_KURDISH -> R.xml.keys_letters_central_kurdish
Expand Down
186 changes: 186 additions & 0 deletions app/src/main/res/xml/keys_letters_belarusian_cyrl.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
<?xml version="1.0" encoding="utf-8"?>
<Keyboard xmlns:app="http://schemas.android.com/apk/res-auto">
<Row app:isNumbersRow="true">
<Key
app:keyEdgeFlags="left"
app:keyLabel="1"
app:topSmallNumber="1" />
<Key
app:keyLabel="2"
app:topSmallNumber="2" />
<Key
app:keyLabel="3"
app:topSmallNumber="3" />
<Key
app:keyLabel="4"
app:topSmallNumber="4" />
<Key
app:keyLabel="5"
app:topSmallNumber="5" />
<Key
app:keyLabel="6"
app:topSmallNumber="6" />
<Key
app:keyLabel="7"
app:topSmallNumber="7" />
<Key
app:keyLabel="8"
app:topSmallNumber="8" />
<Key
app:keyLabel="9"
app:topSmallNumber="9" />
<Key
app:keyEdgeFlags="right"
app:keyLabel="0"
app:topSmallNumber="0" />
</Row>
<Row app:keyWidth="8.33%p">
<Key
app:keyEdgeFlags="left"
app:keyLabel="й" />
<Key
app:keyLabel="ц"
app:popupCharacters="1"
app:popupKeyboard="@xml/keyboard_popup_template"
app:topSmallNumber="1" />
<Key
app:keyLabel="у"
app:popupCharacters="2"
app:popupKeyboard="@xml/keyboard_popup_template"
app:topSmallNumber="2" />
<Key
app:keyLabel="к"
app:popupCharacters="3"
app:popupKeyboard="@xml/keyboard_popup_template"
app:topSmallNumber="3" />
<Key
app:keyLabel="е"
app:popupCharacters="4є"
app:popupKeyboard="@xml/keyboard_popup_template"
app:topSmallNumber="4" />
<Key
app:keyLabel="н"
app:popupCharacters="5"
app:popupKeyboard="@xml/keyboard_popup_template"
app:topSmallNumber="5" />
<Key
app:keyLabel="г"
app:popupCharacters="6ґ"
app:popupKeyboard="@xml/keyboard_popup_template"
app:topSmallNumber="6" />
<Key
app:keyLabel="ш"
app:popupCharacters="7щ"
app:popupKeyboard="@xml/keyboard_popup_template"
app:topSmallNumber="7" />
<Key
app:keyLabel="ў"
app:popupCharacters="8"
app:popupKeyboard="@xml/keyboard_popup_template"
app:topSmallNumber="8" />
<Key
app:keyLabel="з"
app:popupCharacters="9"
app:popupKeyboard="@xml/keyboard_popup_template"
app:topSmallNumber="9" />
<Key
app:keyLabel="х"
app:popupCharacters="0"
app:popupKeyboard="@xml/keyboard_popup_template"
app:topSmallNumber="0" />
<Key
app:keyEdgeFlags="right"
app:keyLabel="’"
app:popupCharacters="'" />
</Row>
<Row app:keyWidth="8.33%p">
<Key
app:keyEdgeFlags="left"
app:keyLabel="ф" />
<Key app:keyLabel="ы" />
<Key app:keyLabel="в" />
<Key app:keyLabel="а" />
<Key app:keyLabel="п" />
<Key app:keyLabel="р" />
<Key app:keyLabel="о" />
<Key app:keyLabel="л" />
<Key app:keyLabel="д" />
<Key app:keyLabel="ж" />
<Key app:keyLabel="э" />
<Key
app:keyEdgeFlags="right"
app:keyLabel="ё" />
</Row>
<Row>
<Key
app:code="-1"
app:keyEdgeFlags="left"
app:keyIcon="@drawable/ic_caps_outline_vector"
app:keyWidth="14%p" />
<Key
app:keyLabel="я"
app:keyWidth="8%p" />
<Key
app:keyLabel="ч"
app:keyWidth="8%p" />
<Key
app:keyLabel="с"
app:keyWidth="8%p" />
<Key
app:keyLabel="м"
app:keyWidth="8%p" />
<Key
app:keyLabel="і"
app:popupCharacters="иї"
app:keyWidth="8%p" />
<Key
app:keyLabel="т"
app:keyWidth="8%p" />
<Key
app:keyLabel="ь"
app:popupCharacters="ъ"
app:keyWidth="8%p" />
<Key
app:keyLabel="б"
app:keyWidth="8%p" />
<Key
app:keyLabel="ю"
app:keyWidth="8%p" />
<Key
app:code="-5"
app:isRepeatable="true"
app:keyEdgeFlags="right"
app:keyIcon="@drawable/ic_clear_vector"
app:keyWidth="14%p" />
</Row>
<Row>
<Key
app:code="-2"
app:keyEdgeFlags="left"
app:keyLabel="\?123"
app:keyWidth="15%p" />
<Key
app:keyLabel=","
app:keyWidth="10%p" />
<Key
app:code="-6"
app:keyEdgeFlags="left"
app:keyIcon="@drawable/ic_emoji_emotions_outline_vector"
app:keyWidth="10%p"
app:secondaryKeyIcon="@drawable/ic_language_outlined" />
<Key
app:code="32"
app:isRepeatable="true"
app:keyWidth="40%p" />
<Key
app:keyLabel="."
app:keyWidth="10%p"
app:popupCharacters=",?!;:…"
app:popupKeyboard="@xml/keyboard_popup_template" />
<Key
app:code="-4"
app:keyEdgeFlags="right"
app:keyIcon="@drawable/ic_enter_vector"
app:keyWidth="15%p" />
</Row>
</Keyboard>
Loading
Loading