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 @@ -207,6 +207,7 @@ 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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This string doesn't exist. You should add it in Commons in https://github.com/FossifyOrg/Commons/blob/master/commons/src/main/res/values/strings.xml. When creating a pull request in Commons, please mention that it's for this one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done: FossifyOrg/Commons#60

Thank you for your instructions!

LANGUAGE_BENGALI -> getString(R.string.translation_bengali)
LANGUAGE_BULGARIAN -> getString(R.string.translation_bulgarian)
LANGUAGE_CHUVASH -> getString(R.string.translation_chuvash)
Expand Down
2 changes: 2 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 @@ -53,10 +53,12 @@ const val LANGUAGE_CHUVASH = 22
const val LANGUAGE_ESPERANTO = 23
const val LANGUAGE_HEBREW = 24
const val LANGUAGE_ARABIC = 25
const val LANGUAGE_BELARUSIAN_CYRL = 27

// Keep this sorted
val SUPPORTED_LANGUAGES = listOf(
LANGUAGE_ARABIC,
LANGUAGE_BELARUSIAN_CYRL,
LANGUAGE_BENGALI,
LANGUAGE_BULGARIAN,
LANGUAGE_CHUVASH,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ 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_belarusian_cyrl
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
LANGUAGE_BELARUSIAN_CYRL -> R.xml.keys_belarusian_cyrl
LANGUAGE_BELARUSIAN_CYRL -> R.xml.keys_letters_belarusian_cyrl

LANGUAGE_BENGALI -> R.xml.keys_letters_bengali
LANGUAGE_BULGARIAN -> R.xml.keys_letters_bulgarian
LANGUAGE_CHUVASH -> R.xml.keys_letters_chuvash
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="10%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="10%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>