From 0226f5d2d418483d9fd38c3a83c966e4c78e66aa Mon Sep 17 00:00:00 2001 From: Dmitriy Chernysh Date: Wed, 11 Oct 2023 21:13:34 +0300 Subject: [PATCH 1/3] Added Polish keyboard layout. Copied from an old pull request #212. Numbers are selected by default on long press. Tested. --- .../keyboard/extensions/Context.kt | 2 + .../keyboard/helpers/Constants.kt | 1 + .../keyboard/services/SimpleKeyboardIME.kt | 1 + app/src/main/res/xml/keys_letters_polish.xml | 174 ++++++++++++++++++ 4 files changed, 178 insertions(+) create mode 100644 app/src/main/res/xml/keys_letters_polish.xml diff --git a/app/src/main/kotlin/com/simplemobiletools/keyboard/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/keyboard/extensions/Context.kt index adad7ea..ee36762 100644 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/extensions/Context.kt @@ -181,6 +181,7 @@ fun Context.getKeyboardLanguages(): ArrayList { RadioItem(LANGUAGE_GREEK, getKeyboardLanguageText(LANGUAGE_GREEK)), RadioItem(LANGUAGE_LITHUANIAN, getKeyboardLanguageText(LANGUAGE_LITHUANIAN)), RadioItem(LANGUAGE_NORWEGIAN, getKeyboardLanguageText(LANGUAGE_NORWEGIAN)), + RadioItem(LANGUAGE_POLISH, getKeyboardLanguageText(LANGUAGE_POLISH)), RadioItem(LANGUAGE_ROMANIAN, getKeyboardLanguageText(LANGUAGE_ROMANIAN)), RadioItem(LANGUAGE_RUSSIAN, getKeyboardLanguageText(LANGUAGE_RUSSIAN)), RadioItem(LANGUAGE_SLOVENIAN, getKeyboardLanguageText(LANGUAGE_SLOVENIAN)), @@ -204,6 +205,7 @@ fun Context.getKeyboardLanguageText(language: Int): String { LANGUAGE_GREEK -> getString(R.string.translation_greek) LANGUAGE_LITHUANIAN -> getString(R.string.translation_lithuanian) LANGUAGE_NORWEGIAN -> getString(R.string.translation_norwegian) + LANGUAGE_POLISH -> getString(R.string.translation_polish) LANGUAGE_ROMANIAN -> getString(R.string.translation_romanian) LANGUAGE_RUSSIAN -> getString(R.string.translation_russian) LANGUAGE_SLOVENIAN -> getString(R.string.translation_slovenian) diff --git a/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/Constants.kt index b8a26cb..6202e60 100644 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/Constants.kt @@ -44,6 +44,7 @@ const val LANGUAGE_SWEDISH = 15 const val LANGUAGE_DANISH = 16 const val LANGUAGE_FRENCH_BEPO = 17 const val LANGUAGE_VIETNAMESE_TELEX = 18 +const val LANGUAGE_POLISH = 19 // keyboard height percentage options const val KEYBOARD_HEIGHT_70_PERCENT = 70 diff --git a/app/src/main/kotlin/com/simplemobiletools/keyboard/services/SimpleKeyboardIME.kt b/app/src/main/kotlin/com/simplemobiletools/keyboard/services/SimpleKeyboardIME.kt index 7f3d81f..d8c9bb2 100644 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/services/SimpleKeyboardIME.kt +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/services/SimpleKeyboardIME.kt @@ -406,6 +406,7 @@ class SimpleKeyboardIME : InputMethodService(), OnKeyboardActionListener, Shared LANGUAGE_GREEK -> R.xml.keys_letters_greek LANGUAGE_LITHUANIAN -> R.xml.keys_letters_lithuanian LANGUAGE_NORWEGIAN -> R.xml.keys_letters_norwegian + LANGUAGE_POLISH -> R.xml.keys_letters_polish LANGUAGE_ROMANIAN -> R.xml.keys_letters_romanian LANGUAGE_RUSSIAN -> R.xml.keys_letters_russian LANGUAGE_SLOVENIAN -> R.xml.keys_letters_slovenian diff --git a/app/src/main/res/xml/keys_letters_polish.xml b/app/src/main/res/xml/keys_letters_polish.xml new file mode 100644 index 0000000..cdcfd48 --- /dev/null +++ b/app/src/main/res/xml/keys_letters_polish.xml @@ -0,0 +1,174 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 6c4d6a0638c4fd0d185bb98d4c6270fe6b7dcff6 Mon Sep 17 00:00:00 2001 From: Dmitriy Chernysh Date: Wed, 11 Oct 2023 22:03:05 +0300 Subject: [PATCH 2/3] Added Ukrainian keyboard layout. As Gboard layout. Close #252 --- .../keyboard/extensions/Context.kt | 2 + .../keyboard/helpers/Constants.kt | 1 + .../keyboard/services/SimpleKeyboardIME.kt | 1 + .../main/res/xml/keys_letters_ukrainian.xml | 186 ++++++++++++++++++ 4 files changed, 190 insertions(+) create mode 100644 app/src/main/res/xml/keys_letters_ukrainian.xml diff --git a/app/src/main/kotlin/com/simplemobiletools/keyboard/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/keyboard/extensions/Context.kt index ee36762..c05e933 100644 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/extensions/Context.kt @@ -188,6 +188,7 @@ fun Context.getKeyboardLanguages(): ArrayList { RadioItem(LANGUAGE_SPANISH, getKeyboardLanguageText(LANGUAGE_SPANISH)), RadioItem(LANGUAGE_SWEDISH, getKeyboardLanguageText(LANGUAGE_SWEDISH)), RadioItem(LANGUAGE_TURKISH_Q, getKeyboardLanguageText(LANGUAGE_TURKISH_Q)), + RadioItem(LANGUAGE_UKRAINIAN, getKeyboardLanguageText(LANGUAGE_UKRAINIAN)), RadioItem(LANGUAGE_VIETNAMESE_TELEX, getKeyboardLanguageText(LANGUAGE_VIETNAMESE_TELEX)), ) } @@ -212,6 +213,7 @@ fun Context.getKeyboardLanguageText(language: Int): String { LANGUAGE_SPANISH -> getString(R.string.translation_spanish) LANGUAGE_SWEDISH -> getString(R.string.translation_swedish) 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)" else -> "${getString(R.string.translation_english)} (QWERTY)" } diff --git a/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/Constants.kt index 6202e60..4c5208c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/Constants.kt @@ -45,6 +45,7 @@ const val LANGUAGE_DANISH = 16 const val LANGUAGE_FRENCH_BEPO = 17 const val LANGUAGE_VIETNAMESE_TELEX = 18 const val LANGUAGE_POLISH = 19 +const val LANGUAGE_UKRAINIAN = 20 // keyboard height percentage options const val KEYBOARD_HEIGHT_70_PERCENT = 70 diff --git a/app/src/main/kotlin/com/simplemobiletools/keyboard/services/SimpleKeyboardIME.kt b/app/src/main/kotlin/com/simplemobiletools/keyboard/services/SimpleKeyboardIME.kt index d8c9bb2..88adcd8 100644 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/services/SimpleKeyboardIME.kt +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/services/SimpleKeyboardIME.kt @@ -413,6 +413,7 @@ class SimpleKeyboardIME : InputMethodService(), OnKeyboardActionListener, Shared LANGUAGE_SWEDISH -> R.xml.keys_letters_swedish LANGUAGE_SPANISH -> R.xml.keys_letters_spanish_qwerty LANGUAGE_TURKISH_Q -> R.xml.keys_letters_turkish_q + LANGUAGE_UKRAINIAN -> R.xml.keys_letters_ukrainian else -> R.xml.keys_letters_english_qwerty } } diff --git a/app/src/main/res/xml/keys_letters_ukrainian.xml b/app/src/main/res/xml/keys_letters_ukrainian.xml new file mode 100644 index 0000000..b25b618 --- /dev/null +++ b/app/src/main/res/xml/keys_letters_ukrainian.xml @@ -0,0 +1,186 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From d678d5ffb50fb65aad5bd06be67ea5650edd3beb Mon Sep 17 00:00:00 2001 From: Tibor Kaputa Date: Thu, 12 Oct 2023 23:56:51 +0200 Subject: [PATCH 3/3] removing a duplicate empty new line --- app/src/main/res/xml/keys_letters_polish.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/app/src/main/res/xml/keys_letters_polish.xml b/app/src/main/res/xml/keys_letters_polish.xml index cdcfd48..45a1483 100644 --- a/app/src/main/res/xml/keys_letters_polish.xml +++ b/app/src/main/res/xml/keys_letters_polish.xml @@ -171,4 +171,3 @@ app:keyWidth="15%p" /> -