Merge pull request #257 from dmitriy-chernysh/add-polish-and-ukrainian-layout

Add Polish and Ukrainian layouts
This commit is contained in:
Tibor Kaputa 2023-10-12 23:57:10 +02:00 committed by GitHub
commit f048ab5bce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 367 additions and 0 deletions

View File

@ -181,12 +181,14 @@ fun Context.getKeyboardLanguages(): ArrayList<RadioItem> {
RadioItem(LANGUAGE_GREEK, getKeyboardLanguageText(LANGUAGE_GREEK)), RadioItem(LANGUAGE_GREEK, getKeyboardLanguageText(LANGUAGE_GREEK)),
RadioItem(LANGUAGE_LITHUANIAN, getKeyboardLanguageText(LANGUAGE_LITHUANIAN)), RadioItem(LANGUAGE_LITHUANIAN, getKeyboardLanguageText(LANGUAGE_LITHUANIAN)),
RadioItem(LANGUAGE_NORWEGIAN, getKeyboardLanguageText(LANGUAGE_NORWEGIAN)), RadioItem(LANGUAGE_NORWEGIAN, getKeyboardLanguageText(LANGUAGE_NORWEGIAN)),
RadioItem(LANGUAGE_POLISH, getKeyboardLanguageText(LANGUAGE_POLISH)),
RadioItem(LANGUAGE_ROMANIAN, getKeyboardLanguageText(LANGUAGE_ROMANIAN)), RadioItem(LANGUAGE_ROMANIAN, getKeyboardLanguageText(LANGUAGE_ROMANIAN)),
RadioItem(LANGUAGE_RUSSIAN, getKeyboardLanguageText(LANGUAGE_RUSSIAN)), RadioItem(LANGUAGE_RUSSIAN, getKeyboardLanguageText(LANGUAGE_RUSSIAN)),
RadioItem(LANGUAGE_SLOVENIAN, getKeyboardLanguageText(LANGUAGE_SLOVENIAN)), RadioItem(LANGUAGE_SLOVENIAN, getKeyboardLanguageText(LANGUAGE_SLOVENIAN)),
RadioItem(LANGUAGE_SPANISH, getKeyboardLanguageText(LANGUAGE_SPANISH)), RadioItem(LANGUAGE_SPANISH, getKeyboardLanguageText(LANGUAGE_SPANISH)),
RadioItem(LANGUAGE_SWEDISH, getKeyboardLanguageText(LANGUAGE_SWEDISH)), RadioItem(LANGUAGE_SWEDISH, getKeyboardLanguageText(LANGUAGE_SWEDISH)),
RadioItem(LANGUAGE_TURKISH_Q, getKeyboardLanguageText(LANGUAGE_TURKISH_Q)), RadioItem(LANGUAGE_TURKISH_Q, getKeyboardLanguageText(LANGUAGE_TURKISH_Q)),
RadioItem(LANGUAGE_UKRAINIAN, getKeyboardLanguageText(LANGUAGE_UKRAINIAN)),
RadioItem(LANGUAGE_VIETNAMESE_TELEX, getKeyboardLanguageText(LANGUAGE_VIETNAMESE_TELEX)), RadioItem(LANGUAGE_VIETNAMESE_TELEX, getKeyboardLanguageText(LANGUAGE_VIETNAMESE_TELEX)),
) )
} }
@ -204,12 +206,14 @@ fun Context.getKeyboardLanguageText(language: Int): String {
LANGUAGE_GREEK -> getString(R.string.translation_greek) LANGUAGE_GREEK -> getString(R.string.translation_greek)
LANGUAGE_LITHUANIAN -> getString(R.string.translation_lithuanian) LANGUAGE_LITHUANIAN -> getString(R.string.translation_lithuanian)
LANGUAGE_NORWEGIAN -> getString(R.string.translation_norwegian) LANGUAGE_NORWEGIAN -> getString(R.string.translation_norwegian)
LANGUAGE_POLISH -> getString(R.string.translation_polish)
LANGUAGE_ROMANIAN -> getString(R.string.translation_romanian) LANGUAGE_ROMANIAN -> getString(R.string.translation_romanian)
LANGUAGE_RUSSIAN -> getString(R.string.translation_russian) LANGUAGE_RUSSIAN -> getString(R.string.translation_russian)
LANGUAGE_SLOVENIAN -> getString(R.string.translation_slovenian) LANGUAGE_SLOVENIAN -> getString(R.string.translation_slovenian)
LANGUAGE_SPANISH -> getString(R.string.translation_spanish) LANGUAGE_SPANISH -> getString(R.string.translation_spanish)
LANGUAGE_SWEDISH -> getString(R.string.translation_swedish) LANGUAGE_SWEDISH -> getString(R.string.translation_swedish)
LANGUAGE_TURKISH_Q -> "${getString(R.string.translation_turkish)} (Q)" LANGUAGE_TURKISH_Q -> "${getString(R.string.translation_turkish)} (Q)"
LANGUAGE_UKRAINIAN -> getString(R.string.translation_ukrainian)
LANGUAGE_VIETNAMESE_TELEX -> "${getString(R.string.translation_vietnamese)} (Telex)" LANGUAGE_VIETNAMESE_TELEX -> "${getString(R.string.translation_vietnamese)} (Telex)"
else -> "${getString(R.string.translation_english)} (QWERTY)" else -> "${getString(R.string.translation_english)} (QWERTY)"
} }

View File

@ -44,6 +44,8 @@ const val LANGUAGE_SWEDISH = 15
const val LANGUAGE_DANISH = 16 const val LANGUAGE_DANISH = 16
const val LANGUAGE_FRENCH_BEPO = 17 const val LANGUAGE_FRENCH_BEPO = 17
const val LANGUAGE_VIETNAMESE_TELEX = 18 const val LANGUAGE_VIETNAMESE_TELEX = 18
const val LANGUAGE_POLISH = 19
const val LANGUAGE_UKRAINIAN = 20
// keyboard height percentage options // keyboard height percentage options
const val KEYBOARD_HEIGHT_70_PERCENT = 70 const val KEYBOARD_HEIGHT_70_PERCENT = 70

View File

@ -406,12 +406,14 @@ class SimpleKeyboardIME : InputMethodService(), OnKeyboardActionListener, Shared
LANGUAGE_GREEK -> R.xml.keys_letters_greek LANGUAGE_GREEK -> R.xml.keys_letters_greek
LANGUAGE_LITHUANIAN -> R.xml.keys_letters_lithuanian LANGUAGE_LITHUANIAN -> R.xml.keys_letters_lithuanian
LANGUAGE_NORWEGIAN -> R.xml.keys_letters_norwegian LANGUAGE_NORWEGIAN -> R.xml.keys_letters_norwegian
LANGUAGE_POLISH -> R.xml.keys_letters_polish
LANGUAGE_ROMANIAN -> R.xml.keys_letters_romanian LANGUAGE_ROMANIAN -> R.xml.keys_letters_romanian
LANGUAGE_RUSSIAN -> R.xml.keys_letters_russian LANGUAGE_RUSSIAN -> R.xml.keys_letters_russian
LANGUAGE_SLOVENIAN -> R.xml.keys_letters_slovenian LANGUAGE_SLOVENIAN -> R.xml.keys_letters_slovenian
LANGUAGE_SWEDISH -> R.xml.keys_letters_swedish LANGUAGE_SWEDISH -> R.xml.keys_letters_swedish
LANGUAGE_SPANISH -> R.xml.keys_letters_spanish_qwerty LANGUAGE_SPANISH -> R.xml.keys_letters_spanish_qwerty
LANGUAGE_TURKISH_Q -> R.xml.keys_letters_turkish_q LANGUAGE_TURKISH_Q -> R.xml.keys_letters_turkish_q
LANGUAGE_UKRAINIAN -> R.xml.keys_letters_ukrainian
else -> R.xml.keys_letters_english_qwerty else -> R.xml.keys_letters_english_qwerty
} }
} }

View File

@ -0,0 +1,173 @@
<?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>
<Key
app:keyEdgeFlags="left"
app:keyLabel="q"
app:popupCharacters="1"
app:popupKeyboard="@xml/keyboard_popup_template"
app:topSmallNumber="1" />
<Key
app:keyLabel="w"
app:popupCharacters="2"
app:popupKeyboard="@xml/keyboard_popup_template"
app:topSmallNumber="2" />
<Key
app:keyLabel="e"
app:popupCharacters="3ę"
app:popupKeyboard="@xml/keyboard_popup_template"
app:topSmallNumber="3" />
<Key
app:keyLabel="r"
app:popupCharacters="4"
app:popupKeyboard="@xml/keyboard_popup_template"
app:topSmallNumber="4" />
<Key
app:keyLabel="t"
app:popupCharacters="5"
app:popupKeyboard="@xml/keyboard_popup_template"
app:topSmallNumber="5" />
<Key
app:keyLabel="y"
app:popupCharacters="6"
app:popupKeyboard="@xml/keyboard_popup_template"
app:topSmallNumber="6" />
<Key
app:keyLabel="u"
app:popupCharacters="7"
app:popupKeyboard="@xml/keyboard_popup_template"
app:topSmallNumber="7" />
<Key
app:keyLabel="i"
app:popupCharacters="8"
app:popupKeyboard="@xml/keyboard_popup_template"
app:topSmallNumber="8" />
<Key
app:keyLabel="o"
app:popupCharacters="9ó"
app:popupKeyboard="@xml/keyboard_popup_template"
app:topSmallNumber="9" />
<Key
app:keyEdgeFlags="right"
app:keyLabel="p"
app:popupCharacters="0"
app:popupKeyboard="@xml/keyboard_popup_template"
app:topSmallNumber="0" />
</Row>
<Row>
<Key
app:horizontalGap="5%"
app:keyEdgeFlags="left"
app:keyLabel="a"
app:popupCharacters="ą"
app:popupKeyboard="@xml/keyboard_popup_template" />
<Key
app:keyLabel="s"
app:popupCharacters="ś"
app:popupKeyboard="@xml/keyboard_popup_template" />
<Key app:keyLabel="d" />
<Key app:keyLabel="f" />
<Key app:keyLabel="g" />
<Key app:keyLabel="h" />
<Key app:keyLabel="j" />
<Key app:keyLabel="k" />
<Key
app:keyEdgeFlags="right"
app:keyLabel="l"
app:popupCharacters="ł"
app:popupKeyboard="@xml/keyboard_popup_template" />
</Row>
<Row>
<Key
app:code="-1"
app:keyEdgeFlags="left"
app:keyIcon="@drawable/ic_caps_outline_vector"
app:keyWidth="15%p" />
<Key
app:keyLabel="z"
app:popupCharacters="źż"
app:popupKeyboard="@xml/keyboard_popup_template" />
<Key app:keyLabel="x" />
<Key
app:keyLabel="c"
app:popupCharacters="ć"
app:popupKeyboard="@xml/keyboard_popup_template" />
<Key app:keyLabel="v" />
<Key app:keyLabel="b" />
<Key
app:keyLabel="n"
app:popupCharacters="ń"
app:popupKeyboard="@xml/keyboard_popup_template" />
<Key app:keyLabel="m" />
<Key
app:code="-5"
app:isRepeatable="true"
app:keyEdgeFlags="right"
app:keyIcon="@drawable/ic_clear_vector"
app:keyWidth="15%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>

View File

@ -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="ї" />
</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: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: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>