From 297380bb81b562bedbb47645976f75d24dca91a8 Mon Sep 17 00:00:00 2001 From: "Josep M. Ferrer" Date: Fri, 19 May 2023 16:00:30 +0000 Subject: [PATCH 01/47] Translated using Weblate (Catalan) Currently translated at 100.0% (33 of 33 strings) Translation: Simple Mobile Tools/Simple Keyboard Translate-URL: https://hosted.weblate.org/projects/simple-mobile-tools/simple-keyboard/ca/ --- app/src/main/res/values-ca/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values-ca/strings.xml b/app/src/main/res/values-ca/strings.xml index 18aed19..3263588 100644 --- a/app/src/main/res/values-ca/strings.xml +++ b/app/src/main/res/values-ca/strings.xml @@ -34,7 +34,7 @@ Alçada del teclat Mostra les vores de les tecles Mostra els números en una fila separada - Start sentences with a capital letter + Comença les frases amb una lletra majúscula Emojis Emoji\'s الرموز التعبيرية الرموز التعبيرية Emojis Emoji\'s - + Start sentences with a capital letter + \ No newline at end of file From dfa0b419d81fb47badcdb648043ec53509dd3544 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Mon, 22 May 2023 19:15:29 +0000 Subject: [PATCH 09/47] Translated using Weblate (Dutch) Currently translated at 96.9% (32 of 33 strings) Translation: Simple Mobile Tools/Simple Keyboard Translate-URL: https://hosted.weblate.org/projects/simple-mobile-tools/simple-keyboard/nl/ --- app/src/main/res/values-nl/strings.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 95f68fb..13bc3d1 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -41,4 +41,5 @@ Haven't found some strings? There's more at https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res --> - + Start sentences with a capital letter + \ No newline at end of file From 12ef3e2e6fe4cf01bbdc2cef0d04b04cadd84a4b Mon Sep 17 00:00:00 2001 From: Anonymous Date: Mon, 22 May 2023 19:15:30 +0000 Subject: [PATCH 10/47] Translated using Weblate (Arabic) Currently translated at 96.9% (32 of 33 strings) Translation: Simple Mobile Tools/Simple Keyboard Translate-URL: https://hosted.weblate.org/projects/simple-mobile-tools/simple-keyboard/ar/ --- app/src/main/res/values-ar/strings.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index 385f894..e50f314 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -41,4 +41,5 @@ Haven't found some strings? There's more at https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res --> - + Start sentences with a capital letter + \ No newline at end of file From 8d1a2b80ab7850e188c50d6ec776f789d27efc0e Mon Sep 17 00:00:00 2001 From: Guillaume Date: Mon, 22 May 2023 20:04:49 +0000 Subject: [PATCH 11/47] Translated using Weblate (Dutch) Currently translated at 100.0% (33 of 33 strings) Translation: Simple Mobile Tools/Simple Keyboard Translate-URL: https://hosted.weblate.org/projects/simple-mobile-tools/simple-keyboard/nl/ --- app/src/main/res/values-nl/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 13bc3d1..a828b76 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -41,5 +41,5 @@ Haven't found some strings? There's more at https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res --> - Start sentences with a capital letter + Zin met een hoofdletter beginnen \ No newline at end of file From e8fb1e8db761ded3b64de1767caa91beeed1dfa0 Mon Sep 17 00:00:00 2001 From: "Josep M. Ferrer" Date: Tue, 23 May 2023 06:38:28 +0000 Subject: [PATCH 12/47] Translated using Weblate (Catalan) Currently translated at 100.0% (33 of 33 strings) Translation: Simple Mobile Tools/Simple Keyboard Translate-URL: https://hosted.weblate.org/projects/simple-mobile-tools/simple-keyboard/ca/ --- app/src/main/res/values-ca/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values-ca/strings.xml b/app/src/main/res/values-ca/strings.xml index 20e2f5c..cf93528 100644 --- a/app/src/main/res/values-ca/strings.xml +++ b/app/src/main/res/values-ca/strings.xml @@ -41,5 +41,5 @@ Haven't found some strings? There's more at https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res --> - Start sentences with a capital letter + Comença les frases amb majúscula \ No newline at end of file From 6ee70cc5bc349a55736ed9711ece3fc995730903 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Priit=20J=C3=B5er=C3=BC=C3=BCt?= Date: Wed, 24 May 2023 05:37:20 +0000 Subject: [PATCH 13/47] Translated using Weblate (Estonian) Currently translated at 100.0% (33 of 33 strings) Translation: Simple Mobile Tools/Simple Keyboard Translate-URL: https://hosted.weblate.org/projects/simple-mobile-tools/simple-keyboard/et/ --- app/src/main/res/values-et/strings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/values-et/strings.xml b/app/src/main/res/values-et/strings.xml index 95c9690..34b5bbf 100644 --- a/app/src/main/res/values-et/strings.xml +++ b/app/src/main/res/values-et/strings.xml @@ -34,11 +34,11 @@ Klaviatuuri kõrgus Näita klahvide ääriseid Näita numbreid eraldi real - Start sentences with a capital letter + Alusta lauseid suurtähega Emojid - + \ No newline at end of file From 5738029991e06deb09e21d25ae8af28c5aec2aef Mon Sep 17 00:00:00 2001 From: merkost Date: Thu, 25 May 2023 23:19:53 +1000 Subject: [PATCH 14/47] Language.kt - added sorted function --- .../kotlin/com/simplemobiletools/keyboard/extensions/Context.kt | 2 +- .../kotlin/com/simplemobiletools/keyboard/helpers/Language.kt | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) 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 8b842be..75e8aa8 100644 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/extensions/Context.kt @@ -149,7 +149,7 @@ fun Context.setupKeyboardDialogStuff( } fun Context.getKeyboardLanguages(): ArrayList { - val languages = Language.values().map { RadioItem(it.ordinal, it.getName(this)) } + val languages = Language.sorted(this).map { RadioItem(it.ordinal, it.getName(this)) } return ArrayList(languages) } diff --git a/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/Language.kt b/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/Language.kt index 9fe9d87..dd6be24 100644 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/Language.kt +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/Language.kt @@ -60,6 +60,8 @@ enum class Language(@StringRes private val stringRes: Int, private val layout: I } companion object { + fun sorted(context: Context) = Language.values().sortedBy { context.getString(it.stringRes) } + fun getKeyboardLayout(keyboardLanguage: Int): Int { return Language.values().getOrElse(keyboardLanguage) { ENGLISH_QWERTY }.layout } From 326772789b67793ace75ed3a4cd719497150f8b2 Mon Sep 17 00:00:00 2001 From: merkost Date: Fri, 26 May 2023 08:57:59 +1000 Subject: [PATCH 15/47] Language.kt - languages sorted inside enum --- .../keyboard/helpers/Language.kt | 72 +++++++++---------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/Language.kt b/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/Language.kt index c90dee3..5656b79 100644 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/Language.kt +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/Language.kt @@ -5,56 +5,56 @@ import androidx.annotation.StringRes import com.simplemobiletools.keyboard.R enum class Language(@StringRes private val stringRes: Int, private val layout: Int) { - ENGLISH_QWERTY( - R.string.translation_english, R.xml.keys_letters_english_qwerty - ), - RUSSIAN( - R.string.translation_russian, R.xml.keys_letters_russian - ), - FRENCH( - R.string.translation_french, R.xml.keys_letters_french - ), - ENGLISH_QWERTZ( - R.string.translation_english, R.xml.keys_letters_english_qwertz - ), - SPANISH( - R.string.translation_spanish, R.string.translation_spanish - ), - GERMAN( - R.string.translation_german, R.xml.keys_letters_german - ), - ENGLISH_DVORAK( - R.string.translation_english, R.xml.keys_letters_english_dvorak - ), - ROMANIAN( - R.string.translation_romanian, R.xml.keys_letters_romanian - ), - SLOVENIAN( - R.string.translation_slovenian, R.xml.keys_letters_slovenian + BENGALI( + R.string.translation_bengali, R.xml.keys_letters_bengali ), BULGARIAN( R.string.translation_bulgarian, R.xml.keys_letters_bulgarian ), - TURKISH_Q( - R.string.translation_turkish, R.xml.keys_letters_turkish_q + DANISH( + R.string.translation_danish, R.xml.keys_letters_danish ), - LITHUANIAN( - R.string.translation_lithuanian, R.xml.keys_letters_lithuanian + ENGLISH_DVORAK( + R.string.translation_english, R.xml.keys_letters_english_dvorak ), - BENGALI( - R.string.translation_bengali, R.xml.keys_letters_bengali + ENGLISH_QWERTY( + R.string.translation_english, R.xml.keys_letters_english_qwerty + ), + ENGLISH_QWERTZ( + R.string.translation_english, R.xml.keys_letters_english_qwertz + ), + FRENCH( + R.string.translation_french, R.xml.keys_letters_french + ), + GERMAN( + R.string.translation_german, R.xml.keys_letters_german ), GREEK( R.string.translation_greek, R.xml.keys_letters_greek ), - Norwegian( + LITHUANIAN( + R.string.translation_lithuanian, R.xml.keys_letters_lithuanian + ), + NORWEGIAN( R.string.translation_norwegian, R.xml.keys_letters_norwegian ), - Swedish( + ROMANIAN( + R.string.translation_romanian, R.xml.keys_letters_romanian + ), + RUSSIAN( + R.string.translation_russian, R.xml.keys_letters_russian + ), + SLOVENIAN( + R.string.translation_slovenian, R.xml.keys_letters_slovenian + ), + SPANISH( + R.string.translation_spanish, R.string.translation_spanish + ), + SWEDISH( R.string.translation_swedish, R.xml.keys_letters_swedish ), - Danish( - R.string.translation_danish, R.xml.keys_letters_danish + TURKISH_Q( + R.string.translation_turkish, R.xml.keys_letters_turkish_q ); fun getName(context: Context): String { From 81735d29a1bb70ffe38efe36b624398412314f65 Mon Sep 17 00:00:00 2001 From: Rex_sa Date: Thu, 25 May 2023 06:08:47 +0000 Subject: [PATCH 16/47] Translated using Weblate (Arabic) Currently translated at 100.0% (33 of 33 strings) Translation: Simple Mobile Tools/Simple Keyboard Translate-URL: https://hosted.weblate.org/projects/simple-mobile-tools/simple-keyboard/ar/ --- app/src/main/res/values-ar/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index e50f314..e373717 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -41,5 +41,5 @@ Haven't found some strings? There's more at https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res --> - Start sentences with a capital letter + بدء الجمل بحرف كبير \ No newline at end of file From e59f97751599ed467e807cf76a142fe9d090eabc Mon Sep 17 00:00:00 2001 From: en2sv Date: Fri, 26 May 2023 18:01:36 +0000 Subject: [PATCH 17/47] Translated using Weblate (Swedish) Currently translated at 100.0% (33 of 33 strings) Translation: Simple Mobile Tools/Simple Keyboard Translate-URL: https://hosted.weblate.org/projects/simple-mobile-tools/simple-keyboard/sv/ --- app/src/main/res/values-sv/strings.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 9399c1c..1d71125 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -15,7 +15,7 @@ Nuvarande Nålad Lägg till ett nytt objekt - Du kan hantera eller addera nya klipp här för snabb tillgänglighet. + Du kan hantera eller lägga till klipp här för snabb åtkomst. Klipp text Nåla text Text har blivit nålad @@ -34,11 +34,11 @@ Tangentbordshöjd Visa ramar runt tangenterna Visa siffror på en separat rad - Start sentences with a capital letter + Börja meningar med stor bokstav Emojier - + \ No newline at end of file From e6ebac65a1710161e4b859a79be9242a6058140f Mon Sep 17 00:00:00 2001 From: gallegonovato Date: Fri, 26 May 2023 10:17:25 +0000 Subject: [PATCH 18/47] Translated using Weblate (Spanish) Currently translated at 100.0% (33 of 33 strings) Translation: Simple Mobile Tools/Simple Keyboard Translate-URL: https://hosted.weblate.org/projects/simple-mobile-tools/simple-keyboard/es/ --- app/src/main/res/values-es/strings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index f40bd12..15b852c 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -34,11 +34,11 @@ Altura del teclado Mostrar bordes de las teclas Mostrar los números en una fila separada - Start sentences with a capital letter + Empezar las frases con mayúsculas Emoticonos - + \ No newline at end of file From 7bd17e42dc14ed72e2e35920ad6b046ee239faf7 Mon Sep 17 00:00:00 2001 From: Tibor Kaputa Date: Sat, 27 May 2023 17:21:23 +0200 Subject: [PATCH 19/47] Update strings.xml --- app/src/main/res/values-ar/strings.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index e373717..385f894 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -41,5 +41,4 @@ Haven't found some strings? There's more at https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res --> - بدء الجمل بحرف كبير - \ No newline at end of file + From 7dd83182a302f88465cbd602244f1476ec2bd891 Mon Sep 17 00:00:00 2001 From: Tibor Kaputa Date: Sat, 27 May 2023 17:21:37 +0200 Subject: [PATCH 20/47] Update strings.xml --- app/src/main/res/values-ca/strings.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/src/main/res/values-ca/strings.xml b/app/src/main/res/values-ca/strings.xml index cf93528..5cb2829 100644 --- a/app/src/main/res/values-ca/strings.xml +++ b/app/src/main/res/values-ca/strings.xml @@ -41,5 +41,4 @@ Haven't found some strings? There's more at https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res --> - Comença les frases amb majúscula - \ No newline at end of file + From 92fa95eb196611baff87216f653f08700aa9e189 Mon Sep 17 00:00:00 2001 From: Tibor Kaputa Date: Sat, 27 May 2023 17:21:49 +0200 Subject: [PATCH 21/47] Update strings.xml --- app/src/main/res/values-nl/strings.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index a828b76..95f68fb 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -41,5 +41,4 @@ Haven't found some strings? There's more at https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res --> - Zin met een hoofdletter beginnen - \ No newline at end of file + From 8398eaff1b40c09e404f75d44d12bf6aea24c247 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kry=C5=A1tof=20=C4=8Cern=C3=BD?= Date: Sat, 27 May 2023 08:31:56 +0000 Subject: [PATCH 22/47] Translated using Weblate (Czech) Currently translated at 100.0% (33 of 33 strings) Translation: Simple Mobile Tools/Simple Keyboard Translate-URL: https://hosted.weblate.org/projects/simple-mobile-tools/simple-keyboard/cs/ --- app/src/main/res/values-cs/strings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index db987b0..cb2859f 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -34,11 +34,11 @@ Výška klávesnice Zobrazit ohraničení kláves Zobrazit čísla na samostatném řádku - Start sentences with a capital letter + Začínat věty velkým písmenem Emotikony - + \ No newline at end of file From 88c4bb5ebb03f9fe7a49f7aef18705693fc27603 Mon Sep 17 00:00:00 2001 From: merkost Date: Mon, 29 May 2023 17:18:35 +1000 Subject: [PATCH 23/47] Removed languages refactoring (Language.kt enum) --- .../keyboard/extensions/Context.kt | 50 +++++++++-- .../keyboard/helpers/Config.kt | 4 +- .../keyboard/helpers/Constants.kt | 18 ++++ .../keyboard/helpers/Language.kt | 83 ------------------- .../keyboard/services/SimpleKeyboardIME.kt | 22 ++++- 5 files changed, 83 insertions(+), 94 deletions(-) delete mode 100644 app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/Language.kt 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 75e8aa8..7a62833 100644 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/extensions/Context.kt @@ -4,11 +4,7 @@ import android.content.ClipboardManager import android.content.Context import android.graphics.Color import android.os.IBinder -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import android.view.Window -import android.view.WindowManager +import android.view.* import android.widget.TextView import androidx.appcompat.app.AlertDialog import androidx.core.content.res.ResourcesCompat @@ -149,9 +145,47 @@ fun Context.setupKeyboardDialogStuff( } fun Context.getKeyboardLanguages(): ArrayList { - val languages = Language.sorted(this).map { RadioItem(it.ordinal, it.getName(this)) } - return ArrayList(languages) + return arrayListOf( + RadioItem(LANGUAGE_BENGALI, getKeyboardLanguageText(LANGUAGE_BENGALI)), + RadioItem(LANGUAGE_BULGARIAN, getKeyboardLanguageText(LANGUAGE_BULGARIAN)), + RadioItem(LANGUAGE_DANISH, getKeyboardLanguageText(LANGUAGE_DANISH)), + RadioItem(LANGUAGE_ENGLISH_QWERTY, getKeyboardLanguageText(LANGUAGE_ENGLISH_QWERTY)), + RadioItem(LANGUAGE_ENGLISH_QWERTZ, getKeyboardLanguageText(LANGUAGE_ENGLISH_QWERTZ)), + RadioItem(LANGUAGE_ENGLISH_DVORAK, getKeyboardLanguageText(LANGUAGE_ENGLISH_DVORAK)), + RadioItem(LANGUAGE_FRENCH, getKeyboardLanguageText(LANGUAGE_FRENCH)), + RadioItem(LANGUAGE_GERMAN, getKeyboardLanguageText(LANGUAGE_GERMAN)), + RadioItem(LANGUAGE_GREEK, getKeyboardLanguageText(LANGUAGE_GREEK)), + RadioItem(LANGUAGE_LITHUANIAN, getKeyboardLanguageText(LANGUAGE_LITHUANIAN)), + RadioItem(LANGUAGE_NORWEGIAN, getKeyboardLanguageText(LANGUAGE_NORWEGIAN)), + RadioItem(LANGUAGE_ROMANIAN, getKeyboardLanguageText(LANGUAGE_ROMANIAN)), + RadioItem(LANGUAGE_RUSSIAN, getKeyboardLanguageText(LANGUAGE_RUSSIAN)), + RadioItem(LANGUAGE_SLOVENIAN, getKeyboardLanguageText(LANGUAGE_SLOVENIAN)), + RadioItem(LANGUAGE_SPANISH, getKeyboardLanguageText(LANGUAGE_SPANISH)), + RadioItem(LANGUAGE_SWEDISH, getKeyboardLanguageText(LANGUAGE_SWEDISH)), + RadioItem(LANGUAGE_TURKISH_Q, getKeyboardLanguageText(LANGUAGE_TURKISH_Q)), + ) +} + +fun Context.getKeyboardLanguageText(language: Int): String { + return when (language) { + LANGUAGE_BENGALI -> getString(R.string.translation_bengali) + LANGUAGE_BULGARIAN -> getString(R.string.translation_bulgarian) + LANGUAGE_DANISH -> getString(R.string.translation_danish) + LANGUAGE_ENGLISH_DVORAK -> "${getString(R.string.translation_english)} (DVORAK)" + LANGUAGE_ENGLISH_QWERTZ -> "${getString(R.string.translation_english)} (QWERTZ)" + LANGUAGE_FRENCH -> getString(R.string.translation_french) + LANGUAGE_GERMAN -> getString(R.string.translation_german) + LANGUAGE_GREEK -> getString(R.string.translation_greek) + LANGUAGE_LITHUANIAN -> getString(R.string.translation_lithuanian) + LANGUAGE_NORWEGIAN -> getString(R.string.translation_norwegian) + LANGUAGE_ROMANIAN -> getString(R.string.translation_romanian) + LANGUAGE_RUSSIAN -> getString(R.string.translation_russian) + LANGUAGE_SLOVENIAN -> getString(R.string.translation_slovenian) + LANGUAGE_SPANISH -> getString(R.string.translation_spanish) + LANGUAGE_SWEDISH -> getString(R.string.translation_swedish) + LANGUAGE_TURKISH_Q -> "${getString(R.string.translation_turkish)} (Q)" + else -> "${getString(R.string.translation_english)} (QWERTY)" + } } -fun Context.getKeyboardLanguageText(language: Int) = Language.getKeyboardName(this, language) diff --git a/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/Config.kt index 06cb020..c612e27 100644 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/Config.kt @@ -48,9 +48,9 @@ class Config(context: Context) : BaseConfig(context) { private fun getDefaultLanguage(): Int { val conf = context.resources.configuration return if (conf.locale.toString().toLowerCase(Locale.getDefault()).startsWith("ru_")) { - Language.RUSSIAN.ordinal + LANGUAGE_RUSSIAN } else { - Language.ENGLISH_QWERTY.ordinal + LANGUAGE_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 a49ebf8..3045fde 100644 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/Constants.kt @@ -75,6 +75,24 @@ const val SHOW_NUMBERS_ROW = "show_numbers_row" const val ITEM_SECTION_LABEL = 0 const val ITEM_CLIP = 1 +const val LANGUAGE_ENGLISH_QWERTY = 0 +const val LANGUAGE_RUSSIAN = 1 +const val LANGUAGE_FRENCH = 2 +const val LANGUAGE_ENGLISH_QWERTZ = 3 +const val LANGUAGE_SPANISH = 4 +const val LANGUAGE_GERMAN = 5 +const val LANGUAGE_ENGLISH_DVORAK = 6 +const val LANGUAGE_ROMANIAN = 7 +const val LANGUAGE_SLOVENIAN = 8 +const val LANGUAGE_BULGARIAN = 9 +const val LANGUAGE_TURKISH_Q = 10 +const val LANGUAGE_LITHUANIAN = 11 +const val LANGUAGE_BENGALI = 12 +const val LANGUAGE_GREEK = 13 +const val LANGUAGE_NORWEGIAN = 14 +const val LANGUAGE_SWEDISH = 15 +const val LANGUAGE_DANISH = 16 + // keyboard height multiplier options const val KEYBOARD_HEIGHT_MULTIPLIER_SMALL = 1 const val KEYBOARD_HEIGHT_MULTIPLIER_MEDIUM = 2 diff --git a/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/Language.kt b/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/Language.kt deleted file mode 100644 index 5656b79..0000000 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/Language.kt +++ /dev/null @@ -1,83 +0,0 @@ -package com.simplemobiletools.keyboard.helpers - -import android.content.Context -import androidx.annotation.StringRes -import com.simplemobiletools.keyboard.R - -enum class Language(@StringRes private val stringRes: Int, private val layout: Int) { - BENGALI( - R.string.translation_bengali, R.xml.keys_letters_bengali - ), - BULGARIAN( - R.string.translation_bulgarian, R.xml.keys_letters_bulgarian - ), - DANISH( - R.string.translation_danish, R.xml.keys_letters_danish - ), - ENGLISH_DVORAK( - R.string.translation_english, R.xml.keys_letters_english_dvorak - ), - ENGLISH_QWERTY( - R.string.translation_english, R.xml.keys_letters_english_qwerty - ), - ENGLISH_QWERTZ( - R.string.translation_english, R.xml.keys_letters_english_qwertz - ), - FRENCH( - R.string.translation_french, R.xml.keys_letters_french - ), - GERMAN( - R.string.translation_german, R.xml.keys_letters_german - ), - GREEK( - R.string.translation_greek, R.xml.keys_letters_greek - ), - LITHUANIAN( - R.string.translation_lithuanian, R.xml.keys_letters_lithuanian - ), - NORWEGIAN( - R.string.translation_norwegian, R.xml.keys_letters_norwegian - ), - ROMANIAN( - R.string.translation_romanian, R.xml.keys_letters_romanian - ), - RUSSIAN( - R.string.translation_russian, R.xml.keys_letters_russian - ), - SLOVENIAN( - R.string.translation_slovenian, R.xml.keys_letters_slovenian - ), - SPANISH( - R.string.translation_spanish, R.string.translation_spanish - ), - SWEDISH( - R.string.translation_swedish, R.xml.keys_letters_swedish - ), - TURKISH_Q( - R.string.translation_turkish, R.xml.keys_letters_turkish_q - ); - - fun getName(context: Context): String { - with(context) { - return when (val language = this@Language) { - ENGLISH_DVORAK -> "${getString(language.stringRes)} (DVORAK)" - ENGLISH_QWERTY -> "${getString(language.stringRes)} (QWERTY)" - ENGLISH_QWERTZ -> "${getString(language.stringRes)} (QWERTZ)" - else -> getString(language.stringRes) - } - } - } - - companion object { - fun sorted(context: Context) = Language.values().sortedBy { context.getString(it.stringRes) } - - fun getKeyboardLayout(keyboardLanguage: Int): Int { - return Language.values().getOrElse(keyboardLanguage) { ENGLISH_QWERTY }.layout - } - - fun getKeyboardName(context: Context, language: Int): String { - return Language.values().getOrElse(language) { ENGLISH_QWERTY }.getName(context) - } - } - -} 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 2c6faa8..fc6c529 100644 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/services/SimpleKeyboardIME.kt +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/services/SimpleKeyboardIME.kt @@ -294,7 +294,27 @@ class SimpleKeyboardIME : InputMethodService(), MyKeyboardView.OnKeyboardActionL } } - private fun getKeyboardLayoutXML() = Language.getKeyboardLayout(baseContext.config.keyboardLanguage) + private fun getKeyboardLayoutXML(): Int { + return when (baseContext.config.keyboardLanguage) { + LANGUAGE_BENGALI -> R.xml.keys_letters_bengali + LANGUAGE_BULGARIAN -> R.xml.keys_letters_bulgarian + LANGUAGE_DANISH -> R.xml.keys_letters_danish + LANGUAGE_ENGLISH_DVORAK -> R.xml.keys_letters_english_dvorak + LANGUAGE_ENGLISH_QWERTZ -> R.xml.keys_letters_english_qwertz + LANGUAGE_FRENCH -> R.xml.keys_letters_french + LANGUAGE_GERMAN -> R.xml.keys_letters_german + LANGUAGE_GREEK -> R.xml.keys_letters_greek + LANGUAGE_LITHUANIAN -> R.xml.keys_letters_lithuanian + LANGUAGE_NORWEGIAN -> R.xml.keys_letters_norwegian + LANGUAGE_ROMANIAN -> R.xml.keys_letters_romanian + LANGUAGE_RUSSIAN -> R.xml.keys_letters_russian + LANGUAGE_SLOVENIAN -> R.xml.keys_letters_slovenian + LANGUAGE_SWEDISH -> R.xml.keys_letters_swedish + LANGUAGE_SPANISH -> R.xml.keys_letters_spanish_qwerty + LANGUAGE_TURKISH_Q -> R.xml.keys_letters_turkish_q + else -> R.xml.keys_letters_english_qwerty + } + } override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) { keyboardView?.setupKeyboard() From aa87b0b9f833b0b0dd7907539453ae17f51760e5 Mon Sep 17 00:00:00 2001 From: spkprs Date: Mon, 29 May 2023 22:11:59 +0300 Subject: [PATCH 24/47] Update strings.xml --- app/src/main/res/values-el/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index 7e2ac5a..830ca70 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -34,7 +34,7 @@ Ύψος πληκτρολογίου Εμφάνιση ορίων πλήκτρου Εμφάνιση αριθμών σε ξεχωριστή γραμμή - Start sentences with a capital letter + Αρχίστε τις προτάσεις με κεφαλαίο γράμμα Emojis Emotikony - + \ No newline at end of file From f9cdecdb32dc5db102e7796688b9e29a9c56bf5e Mon Sep 17 00:00:00 2001 From: merkost Date: Tue, 30 May 2023 16:41:54 +1000 Subject: [PATCH 26/47] Languages xml refactored and fixed numbers popup --- app/src/main/res/xml/keys_letters_danish.xml | 8 ++++---- app/src/main/res/xml/keys_letters_lithuanian.xml | 10 +++++----- app/src/main/res/xml/keys_letters_norwegian.xml | 8 ++++---- app/src/main/res/xml/keys_letters_swedish.xml | 8 ++++---- app/src/main/res/xml/keys_letters_turkish_q.xml | 12 ++++++------ 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/app/src/main/res/xml/keys_letters_danish.xml b/app/src/main/res/xml/keys_letters_danish.xml index f421e68..f0639a5 100644 --- a/app/src/main/res/xml/keys_letters_danish.xml +++ b/app/src/main/res/xml/keys_letters_danish.xml @@ -81,13 +81,13 @@ + app:popupKeyboard="@xml/keyboard_popup_template" /> + app:popupKeyboard="@xml/keyboard_popup_template" /> diff --git a/app/src/main/res/xml/keys_letters_lithuanian.xml b/app/src/main/res/xml/keys_letters_lithuanian.xml index 6ac6345..f27a032 100644 --- a/app/src/main/res/xml/keys_letters_lithuanian.xml +++ b/app/src/main/res/xml/keys_letters_lithuanian.xml @@ -73,7 +73,7 @@ app:topSmallNumber="7" /> + app:keyWidth="10%p" + app:secondaryKeyIcon="@drawable/ic_language_outlined" /> + app:popupKeyboard="@xml/keyboard_popup_template" /> + app:popupKeyboard="@xml/keyboard_popup_template" /> + app:popupKeyboard="@xml/keyboard_popup_template" /> diff --git a/app/src/main/res/xml/keys_letters_swedish.xml b/app/src/main/res/xml/keys_letters_swedish.xml index 7c6f246..8b2c74c 100644 --- a/app/src/main/res/xml/keys_letters_swedish.xml +++ b/app/src/main/res/xml/keys_letters_swedish.xml @@ -81,13 +81,13 @@ + app:popupKeyboard="@xml/keyboard_popup_template" /> + app:popupKeyboard="@xml/keyboard_popup_template" /> + app:keyWidth="10%p" + app:secondaryKeyIcon="@drawable/ic_language_outlined" /> + app:popupKeyboard="@xml/keyboard_popup_template" /> Date: Sat, 3 Jun 2023 19:24:22 +0200 Subject: [PATCH 27/47] Creating a french_bepo key file --- .../main/res/xml/keys_letters_french_bepo.xml | 179 ++++++++++++++++++ 1 file changed, 179 insertions(+) create mode 100644 app/src/main/res/xml/keys_letters_french_bepo.xml diff --git a/app/src/main/res/xml/keys_letters_french_bepo.xml b/app/src/main/res/xml/keys_letters_french_bepo.xml new file mode 100644 index 0000000..eb24dd6 --- /dev/null +++ b/app/src/main/res/xml/keys_letters_french_bepo.xml @@ -0,0 +1,179 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From a5fedc8ade215675aa1472af46e3bf25637746ab Mon Sep 17 00:00:00 2001 From: JdM Date: Sat, 3 Jun 2023 19:44:36 +0200 Subject: [PATCH 28/47] rename key_letters_french to key_letters_french_azerty --- .../simplemobiletools/keyboard/services/SimpleKeyboardIME.kt | 2 +- .../{keys_letters_french.xml => keys_letters_french_azerty.xml} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename app/src/main/res/xml/{keys_letters_french.xml => keys_letters_french_azerty.xml} (100%) 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 fc6c529..54a1052 100644 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/services/SimpleKeyboardIME.kt +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/services/SimpleKeyboardIME.kt @@ -301,7 +301,7 @@ class SimpleKeyboardIME : InputMethodService(), MyKeyboardView.OnKeyboardActionL LANGUAGE_DANISH -> R.xml.keys_letters_danish LANGUAGE_ENGLISH_DVORAK -> R.xml.keys_letters_english_dvorak LANGUAGE_ENGLISH_QWERTZ -> R.xml.keys_letters_english_qwertz - LANGUAGE_FRENCH -> R.xml.keys_letters_french + LANGUAGE_FRENCH -> R.xml.keys_letters_french_azerty LANGUAGE_GERMAN -> R.xml.keys_letters_german LANGUAGE_GREEK -> R.xml.keys_letters_greek LANGUAGE_LITHUANIAN -> R.xml.keys_letters_lithuanian diff --git a/app/src/main/res/xml/keys_letters_french.xml b/app/src/main/res/xml/keys_letters_french_azerty.xml similarity index 100% rename from app/src/main/res/xml/keys_letters_french.xml rename to app/src/main/res/xml/keys_letters_french_azerty.xml From ae33ab91a7b766c70a5157ef3c9406d04534ee9b Mon Sep 17 00:00:00 2001 From: JdM Date: Sat, 3 Jun 2023 19:46:00 +0200 Subject: [PATCH 29/47] rename LANGUAGE_FRENCH to LANGUAGE_FRENCH_AZERTY --- .../com/simplemobiletools/keyboard/extensions/Context.kt | 4 ++-- .../com/simplemobiletools/keyboard/helpers/Constants.kt | 2 +- .../simplemobiletools/keyboard/services/SimpleKeyboardIME.kt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) 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 7a62833..91406f8 100644 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/extensions/Context.kt @@ -152,7 +152,7 @@ fun Context.getKeyboardLanguages(): ArrayList { RadioItem(LANGUAGE_ENGLISH_QWERTY, getKeyboardLanguageText(LANGUAGE_ENGLISH_QWERTY)), RadioItem(LANGUAGE_ENGLISH_QWERTZ, getKeyboardLanguageText(LANGUAGE_ENGLISH_QWERTZ)), RadioItem(LANGUAGE_ENGLISH_DVORAK, getKeyboardLanguageText(LANGUAGE_ENGLISH_DVORAK)), - RadioItem(LANGUAGE_FRENCH, getKeyboardLanguageText(LANGUAGE_FRENCH)), + RadioItem(LANGUAGE_FRENCH_AZERTY, getKeyboardLanguageText(LANGUAGE_FRENCH_AZERTY)), RadioItem(LANGUAGE_GERMAN, getKeyboardLanguageText(LANGUAGE_GERMAN)), RadioItem(LANGUAGE_GREEK, getKeyboardLanguageText(LANGUAGE_GREEK)), RadioItem(LANGUAGE_LITHUANIAN, getKeyboardLanguageText(LANGUAGE_LITHUANIAN)), @@ -173,7 +173,7 @@ fun Context.getKeyboardLanguageText(language: Int): String { LANGUAGE_DANISH -> getString(R.string.translation_danish) LANGUAGE_ENGLISH_DVORAK -> "${getString(R.string.translation_english)} (DVORAK)" LANGUAGE_ENGLISH_QWERTZ -> "${getString(R.string.translation_english)} (QWERTZ)" - LANGUAGE_FRENCH -> getString(R.string.translation_french) + LANGUAGE_FRENCH_AZERTY -> getString(R.string.translation_french) LANGUAGE_GERMAN -> getString(R.string.translation_german) LANGUAGE_GREEK -> getString(R.string.translation_greek) LANGUAGE_LITHUANIAN -> getString(R.string.translation_lithuanian) 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 3045fde..0ea8c4a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/Constants.kt @@ -77,7 +77,7 @@ const val ITEM_CLIP = 1 const val LANGUAGE_ENGLISH_QWERTY = 0 const val LANGUAGE_RUSSIAN = 1 -const val LANGUAGE_FRENCH = 2 +const val LANGUAGE_FRENCH_AZERTY = 2 const val LANGUAGE_ENGLISH_QWERTZ = 3 const val LANGUAGE_SPANISH = 4 const val LANGUAGE_GERMAN = 5 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 54a1052..9fe00be 100644 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/services/SimpleKeyboardIME.kt +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/services/SimpleKeyboardIME.kt @@ -301,7 +301,7 @@ class SimpleKeyboardIME : InputMethodService(), MyKeyboardView.OnKeyboardActionL LANGUAGE_DANISH -> R.xml.keys_letters_danish LANGUAGE_ENGLISH_DVORAK -> R.xml.keys_letters_english_dvorak LANGUAGE_ENGLISH_QWERTZ -> R.xml.keys_letters_english_qwertz - LANGUAGE_FRENCH -> R.xml.keys_letters_french_azerty + LANGUAGE_FRENCH_AZERTY_AZERTY -> R.xml.keys_letters_french_azerty LANGUAGE_GERMAN -> R.xml.keys_letters_german LANGUAGE_GREEK -> R.xml.keys_letters_greek LANGUAGE_LITHUANIAN -> R.xml.keys_letters_lithuanian From bbba02e87bc17a1119759f42a374f848395b98ee Mon Sep 17 00:00:00 2001 From: JdM Date: Sat, 3 Jun 2023 19:46:24 +0200 Subject: [PATCH 30/47] fix typing error --- .../simplemobiletools/keyboard/services/SimpleKeyboardIME.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 9fe00be..9ca238b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/services/SimpleKeyboardIME.kt +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/services/SimpleKeyboardIME.kt @@ -301,7 +301,7 @@ class SimpleKeyboardIME : InputMethodService(), MyKeyboardView.OnKeyboardActionL LANGUAGE_DANISH -> R.xml.keys_letters_danish LANGUAGE_ENGLISH_DVORAK -> R.xml.keys_letters_english_dvorak LANGUAGE_ENGLISH_QWERTZ -> R.xml.keys_letters_english_qwertz - LANGUAGE_FRENCH_AZERTY_AZERTY -> R.xml.keys_letters_french_azerty + LANGUAGE_FRENCH_AZERTY -> R.xml.keys_letters_french_azerty LANGUAGE_GERMAN -> R.xml.keys_letters_german LANGUAGE_GREEK -> R.xml.keys_letters_greek LANGUAGE_LITHUANIAN -> R.xml.keys_letters_lithuanian From 8879e8a0dc82e2b5ab239b69ac3f77f5076fe20f Mon Sep 17 00:00:00 2001 From: JdM Date: Sat, 3 Jun 2023 20:37:53 +0200 Subject: [PATCH 31/47] =?UTF-8?q?Added=20B=C3=89PO=20keyboard=20layouts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/simplemobiletools/keyboard/extensions/Context.kt | 4 +++- .../com/simplemobiletools/keyboard/helpers/Constants.kt | 1 + .../simplemobiletools/keyboard/services/SimpleKeyboardIME.kt | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) 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 91406f8..f5ea032 100644 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/extensions/Context.kt @@ -153,6 +153,7 @@ fun Context.getKeyboardLanguages(): ArrayList { RadioItem(LANGUAGE_ENGLISH_QWERTZ, getKeyboardLanguageText(LANGUAGE_ENGLISH_QWERTZ)), RadioItem(LANGUAGE_ENGLISH_DVORAK, getKeyboardLanguageText(LANGUAGE_ENGLISH_DVORAK)), RadioItem(LANGUAGE_FRENCH_AZERTY, getKeyboardLanguageText(LANGUAGE_FRENCH_AZERTY)), + RadioItem(LANGUAGE_FRENCH_BEPO, getKeyboardLanguageText(LANGUAGE_FRENCH_BEPO)), RadioItem(LANGUAGE_GERMAN, getKeyboardLanguageText(LANGUAGE_GERMAN)), RadioItem(LANGUAGE_GREEK, getKeyboardLanguageText(LANGUAGE_GREEK)), RadioItem(LANGUAGE_LITHUANIAN, getKeyboardLanguageText(LANGUAGE_LITHUANIAN)), @@ -173,7 +174,8 @@ fun Context.getKeyboardLanguageText(language: Int): String { LANGUAGE_DANISH -> getString(R.string.translation_danish) LANGUAGE_ENGLISH_DVORAK -> "${getString(R.string.translation_english)} (DVORAK)" LANGUAGE_ENGLISH_QWERTZ -> "${getString(R.string.translation_english)} (QWERTZ)" - LANGUAGE_FRENCH_AZERTY -> getString(R.string.translation_french) + LANGUAGE_FRENCH_AZERTY -> "${getString(R.string.translation_french)} (AZERTY)" + LANGUAGE_FRENCH_BEPO -> "${getString(R.string.translation_french)} (BEPO)" LANGUAGE_GERMAN -> getString(R.string.translation_german) LANGUAGE_GREEK -> getString(R.string.translation_greek) LANGUAGE_LITHUANIAN -> getString(R.string.translation_lithuanian) 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 0ea8c4a..9c8a912 100644 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/Constants.kt @@ -92,6 +92,7 @@ const val LANGUAGE_GREEK = 13 const val LANGUAGE_NORWEGIAN = 14 const val LANGUAGE_SWEDISH = 15 const val LANGUAGE_DANISH = 16 +const val LANGUAGE_FRENCH_BEPO = 17 // keyboard height multiplier options const val KEYBOARD_HEIGHT_MULTIPLIER_SMALL = 1 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 9ca238b..a59de39 100644 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/services/SimpleKeyboardIME.kt +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/services/SimpleKeyboardIME.kt @@ -302,6 +302,7 @@ class SimpleKeyboardIME : InputMethodService(), MyKeyboardView.OnKeyboardActionL LANGUAGE_ENGLISH_DVORAK -> R.xml.keys_letters_english_dvorak LANGUAGE_ENGLISH_QWERTZ -> R.xml.keys_letters_english_qwertz LANGUAGE_FRENCH_AZERTY -> R.xml.keys_letters_french_azerty + LANGUAGE_FRENCH_BEPO -> R.xml.keys_letters_french_bepo LANGUAGE_GERMAN -> R.xml.keys_letters_german LANGUAGE_GREEK -> R.xml.keys_letters_greek LANGUAGE_LITHUANIAN -> R.xml.keys_letters_lithuanian From ab4125a8f104d8b784d85e52d29f53cc9ea2013b Mon Sep 17 00:00:00 2001 From: JdM Date: Sat, 3 Jun 2023 20:54:25 +0200 Subject: [PATCH 32/47] =?UTF-8?q?Fixed=20b=C3=A9po=20letter=20width=20erro?= =?UTF-8?q?r?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/res/xml/keys_letters_french_bepo.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/src/main/res/xml/keys_letters_french_bepo.xml b/app/src/main/res/xml/keys_letters_french_bepo.xml index eb24dd6..7534aa7 100644 --- a/app/src/main/res/xml/keys_letters_french_bepo.xml +++ b/app/src/main/res/xml/keys_letters_french_bepo.xml @@ -43,7 +43,7 @@ app:topSmallNumber="1" /> + app:keyLabel="a" + app:popupCharacters="áàâãäåāæą" + app:popupKeyboard="@xml/keyboard_popup_template" /> + app:keyIcon="@drawable/ic_caps_outline_vector" /> + app:keyIcon="@drawable/ic_clear_vector" /> Date: Sun, 4 Jun 2023 15:40:46 +0000 Subject: [PATCH 33/47] Translated using Weblate (Portuguese) Currently translated at 100.0% (33 of 33 strings) Translation: Simple Mobile Tools/Simple Keyboard Translate-URL: https://hosted.weblate.org/projects/simple-mobile-tools/simple-keyboard/pt/ --- app/src/main/res/values-pt/strings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index e5a06b4..a031e0d 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -34,11 +34,11 @@ Altura do teclado Mostrar contorno das teclas Mostrar números em linha distinta - Start sentences with a capital letter + Iniciar frases com letra maiúscula Emojis - + \ No newline at end of file From 9901cfbc10867ff73d9fe29304455e706327507a Mon Sep 17 00:00:00 2001 From: merkost Date: Wed, 7 Jun 2023 13:10:33 +1000 Subject: [PATCH 34/47] Added inner AccessHelper class for talkback functional --- .../keyboard/views/MyKeyboardView.kt | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt b/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt index dd1f520..df08539 100644 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt @@ -10,6 +10,7 @@ import android.content.Intent import android.graphics.* import android.graphics.Paint.Align import android.graphics.drawable.* +import android.os.Bundle import android.os.Handler import android.os.Looper import android.os.Message @@ -24,6 +25,9 @@ import android.widget.PopupWindow import android.widget.TextView import androidx.core.animation.doOnEnd import androidx.core.animation.doOnStart +import androidx.core.view.ViewCompat +import androidx.core.view.accessibility.AccessibilityNodeInfoCompat +import androidx.customview.widget.ExploreByTouchHelper import androidx.emoji2.text.EmojiCompat import androidx.emoji2.text.EmojiCompat.EMOJI_SUPPORTED import com.simplemobiletools.commons.extensions.* @@ -95,6 +99,83 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut fun reloadKeyboard() } + override fun dispatchHoverEvent(event: MotionEvent): Boolean { + return if (accessHelper.dispatchHoverEvent(event)) { + true + } else { + super.dispatchHoverEvent(event) + } + } + + private val accessHelper = AccessHelper() + + + inner class AccessHelper() : ExploreByTouchHelper(this) { + + /** + * We need to populate the list with the IDs of all of the visible virtual views (the intervals in the chart). + * In our case, all keys are always visible, so we’ll return a list of all IDs. + */ + override fun getVisibleVirtualViews(virtualViewIds: MutableList) { + val keysSize = mKeyboard?.mKeys?.size ?: 0 + for (i in 0 until keysSize) { + virtualViewIds.add(i) + } + } + + /** + * For this function, we need to return the ID of the virtual view that’s under the x, y position, + * or ExploreByTouchHelper.HOST_ID if there’s no item at those coordinates. + */ + override fun getVirtualViewAt(x: Float, y: Float): Int { + mKeyboard?.mKeys?.filterNotNull()?.let { keyList -> + val rects = keyList.map { + Rect(it.x, it.y, it.x + it.width, it.y + it.height) + } + rects.firstOrNull { it.contains(x.toInt(), y.toInt()) }?.let { exactRect -> + val exactIndexKey = rects.indexOf(exactRect) + return exactIndexKey + } ?: return HOST_ID + } + return HOST_ID + } + + /** + * This is where we provide all the metadata for our virtual view. + * We need to set the content description (or text, if it’s presented visually) and set the bounds in parent. + */ + override fun onPopulateNodeForVirtualView(virtualViewId: Int, node: AccessibilityNodeInfoCompat) { + node.className = MyKeyboardView::class.simpleName + val key = mKeyboard?.mKeys?.get(virtualViewId) + node.contentDescription = key?.label ?: "keyboard key" + val bounds = updateBoundsForInterval(virtualViewId) + node.setBoundsInParent(bounds) + } + + /** + * We need to set the content description (or text, if it’s presented visually) and set the bounds in parent. + * The bounds in the parent should match the logic in the onDraw() function. + */ + private fun updateBoundsForInterval(index: Int): Rect { + val keys = mKeyboard?.mKeys ?: return Rect() + val key = keys[index]!! + return Rect().apply { + left = key.x + top = key.y + right = key.x + key.width + bottom = key.y + key.height + } + } + + override fun onPerformActionForVirtualView(virtualViewId: Int, action: Int, arguments: Bundle?): Boolean { + return false + } + } + + init { + ViewCompat.setAccessibilityDelegate(this, accessHelper) + } + private var mKeyboard: MyKeyboard? = null private var mCurrentKeyIndex: Int = NOT_A_KEY From 52836b8e5ffc96f31bf2cd454dd768ee750a2834 Mon Sep 17 00:00:00 2001 From: merkost Date: Wed, 7 Jun 2023 14:04:05 +1000 Subject: [PATCH 35/47] Added contentDescriptions for the keys and a new string resource --- .../keyboard/helpers/MyKeyboard.kt | 35 +++++++++++++++++++ .../keyboard/views/MyKeyboardView.kt | 2 +- app/src/main/res/values-ru/strings.xml | 3 +- app/src/main/res/values/strings.xml | 1 + 4 files changed, 39 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/MyKeyboard.kt b/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/MyKeyboard.kt index b2c77c0..8a99a82 100644 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/MyKeyboard.kt +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/MyKeyboard.kt @@ -222,6 +222,41 @@ class MyKeyboard { a.recycle() } + /** + * Content description for talkback functional + */ + fun getContentDescription(context: Context): CharSequence { + return when (code) { + KEYCODE_SHIFT -> { + context.getString(R.string.keycode_shift) + } + + KEYCODE_MODE_CHANGE -> { + context.getString(R.string.keycode_mode_change) + } + + KEYCODE_ENTER -> { + context.getString(R.string.keycode_enter) + } + + KEYCODE_DELETE -> { + context.getString(R.string.keycode_delete) + } + + KEYCODE_SPACE -> { + context.getString(R.string.keycode_space) + } + + KEYCODE_EMOJI -> { + context.getString(R.string.emojis) + } + + else -> { + label + } + } + } + /** Create an empty key with no attributes. */ init { height = parent.defaultHeight diff --git a/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt b/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt index df08539..ad1cdcb 100644 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt @@ -147,7 +147,7 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut override fun onPopulateNodeForVirtualView(virtualViewId: Int, node: AccessibilityNodeInfoCompat) { node.className = MyKeyboardView::class.simpleName val key = mKeyboard?.mKeys?.get(virtualViewId) - node.contentDescription = key?.label ?: "keyboard key" + node.contentDescription = key?.getContentDescription(context) val bounds = updateBoundsForInterval(virtualViewId) node.setBoundsInParent(bounds) } diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 930b9fe..e21e865 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -26,6 +26,7 @@ Изменить тип клавиатуры Shift Enter + Пробел Показывать содержимое буфера обмена при наличии Показывать ввод по нажатию @@ -40,4 +41,4 @@ Haven't found some strings? There's more at https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res --> - \ No newline at end of file + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index b26fb32..976b51a 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -26,6 +26,7 @@ Change keyboard type Shift Enter + Space Show clipboard content if available Show a popup on keypress From ca53db62c15af24afe02cb18b5a14ed31eef906b Mon Sep 17 00:00:00 2001 From: merkost Date: Wed, 7 Jun 2023 16:04:33 +1000 Subject: [PATCH 36/47] Fixed content description for pinned clipboard icon --- app/src/main/res/layout/keyboard_view_keyboard.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/layout/keyboard_view_keyboard.xml b/app/src/main/res/layout/keyboard_view_keyboard.xml index ab15eae..16f5682 100644 --- a/app/src/main/res/layout/keyboard_view_keyboard.xml +++ b/app/src/main/res/layout/keyboard_view_keyboard.xml @@ -63,7 +63,7 @@ android:layout_height="@dimen/toolbar_icon_height" android:layout_marginEnd="@dimen/medium_margin" android:background="?android:attr/selectableItemBackgroundBorderless" - android:contentDescription="@string/settings" + android:contentDescription="@string/clipboard_pinned" android:padding="@dimen/small_margin" android:src="@drawable/ic_clipboard_vector" app:layout_constraintBottom_toBottomOf="parent" From 29c8c763c0b64778c9ed2fc5c900e5f8b6fded55 Mon Sep 17 00:00:00 2001 From: merkost Date: Fri, 9 Jun 2023 10:31:08 +1000 Subject: [PATCH 37/47] OnKeyboardActionListener extracted to a different file --- .../interfaces/OnKeyboardActionListener.kt | 41 +++++++++++++++++ .../keyboard/services/SimpleKeyboardIME.kt | 3 +- .../keyboard/views/MyKeyboardView.kt | 46 ++----------------- 3 files changed, 46 insertions(+), 44 deletions(-) create mode 100644 app/src/main/kotlin/com/simplemobiletools/keyboard/interfaces/OnKeyboardActionListener.kt diff --git a/app/src/main/kotlin/com/simplemobiletools/keyboard/interfaces/OnKeyboardActionListener.kt b/app/src/main/kotlin/com/simplemobiletools/keyboard/interfaces/OnKeyboardActionListener.kt new file mode 100644 index 0000000..8f9189a --- /dev/null +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/interfaces/OnKeyboardActionListener.kt @@ -0,0 +1,41 @@ +package com.simplemobiletools.keyboard.interfaces + +interface OnKeyboardActionListener { + /** + * Called when the user presses a key. This is sent before the [.onKey] is called. For keys that repeat, this is only called once. + * @param primaryCode the unicode of the key being pressed. If the touch is not on a valid key, the value will be zero. + */ + fun onPress(primaryCode: Int) + + /** + * Send a key press to the listener. + * @param code this is the key that was pressed + */ + fun onKey(code: Int) + + /** + * Called when the finger has been lifted after pressing a key + */ + fun onActionUp() + + /** + * Called when the user long presses Space and moves to the left + */ + fun moveCursorLeft() + + /** + * Called when the user long presses Space and moves to the right + */ + fun moveCursorRight() + + /** + * Sends a sequence of characters to the listener. + * @param text the string to be displayed. + */ + fun onText(text: String) + + /** + * Called to force the KeyboardView to reload the keyboard + */ + fun reloadKeyboard() +} 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 8e1192e..e880622 100644 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/services/SimpleKeyboardIME.kt +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/services/SimpleKeyboardIME.kt @@ -19,11 +19,12 @@ import com.simplemobiletools.commons.extensions.getSharedPrefs import com.simplemobiletools.keyboard.R import com.simplemobiletools.keyboard.extensions.config import com.simplemobiletools.keyboard.helpers.* +import com.simplemobiletools.keyboard.interfaces.OnKeyboardActionListener import com.simplemobiletools.keyboard.views.MyKeyboardView import kotlinx.android.synthetic.main.keyboard_view_keyboard.view.* // based on https://www.androidauthority.com/lets-build-custom-keyboard-android-832362/ -class SimpleKeyboardIME : InputMethodService(), MyKeyboardView.OnKeyboardActionListener, SharedPreferences.OnSharedPreferenceChangeListener { +class SimpleKeyboardIME : InputMethodService(), OnKeyboardActionListener, SharedPreferences.OnSharedPreferenceChangeListener { private var SHIFT_PERM_TOGGLE_SPEED = 500 // how quickly do we have to doubletap shift to enable permanent caps lock private val KEYBOARD_LETTERS = 0 private val KEYBOARD_SYMBOLS = 1 diff --git a/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt b/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt index ad1cdcb..0fe63c2 100644 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt @@ -47,6 +47,7 @@ import com.simplemobiletools.keyboard.helpers.MyKeyboard.Companion.KEYCODE_ENTER import com.simplemobiletools.keyboard.helpers.MyKeyboard.Companion.KEYCODE_MODE_CHANGE import com.simplemobiletools.keyboard.helpers.MyKeyboard.Companion.KEYCODE_SHIFT import com.simplemobiletools.keyboard.helpers.MyKeyboard.Companion.KEYCODE_SPACE +import com.simplemobiletools.keyboard.interfaces.OnKeyboardActionListener import com.simplemobiletools.keyboard.interfaces.RefreshClipsListener import com.simplemobiletools.keyboard.models.Clip import com.simplemobiletools.keyboard.models.ClipsSectionLabel @@ -55,50 +56,10 @@ import kotlinx.android.synthetic.main.keyboard_popup_keyboard.view.* import kotlinx.android.synthetic.main.keyboard_view_keyboard.view.* import java.util.* -@SuppressLint("UseCompatLoadingForDrawables", "ClickableViewAccessibility") +@SuppressLint("UseCompatLoadingForDrawables") class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: AttributeSet?, defStyleRes: Int = 0) : View(context, attrs, defStyleRes) { - interface OnKeyboardActionListener { - /** - * Called when the user presses a key. This is sent before the [.onKey] is called. For keys that repeat, this is only called once. - * @param primaryCode the unicode of the key being pressed. If the touch is not on a valid key, the value will be zero. - */ - fun onPress(primaryCode: Int) - - /** - * Send a key press to the listener. - * @param code this is the key that was pressed - */ - fun onKey(code: Int) - - /** - * Called when the finger has been lifted after pressing a key - */ - fun onActionUp() - - /** - * Called when the user long presses Space and moves to the left - */ - fun moveCursorLeft() - - /** - * Called when the user long presses Space and moves to the right - */ - fun moveCursorRight() - - /** - * Sends a sequence of characters to the listener. - * @param text the string to be displayed. - */ - fun onText(text: String) - - /** - * Called to force the KeyboardView to reload the keyboard - */ - fun reloadKeyboard() - } - override fun dispatchHoverEvent(event: MotionEvent): Boolean { return if (accessHelper.dispatchHoverEvent(event)) { true @@ -109,7 +70,6 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut private val accessHelper = AccessHelper() - inner class AccessHelper() : ExploreByTouchHelper(this) { /** @@ -560,7 +520,7 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut private fun adjustCase(label: CharSequence): CharSequence? { var newLabel: CharSequence? = label - if (newLabel != null && newLabel.isNotEmpty() && mKeyboard!!.mShiftState > SHIFT_OFF && newLabel.length < 3 && Character.isLowerCase(newLabel[0])) { + if (!newLabel.isNullOrEmpty() && mKeyboard!!.mShiftState > SHIFT_OFF && newLabel.length < 3 && Character.isLowerCase(newLabel[0])) { newLabel = newLabel.toString().uppercase(Locale.getDefault()) } return newLabel From 91852ed63e4067924b7a8674461efd26121a8a64 Mon Sep 17 00:00:00 2001 From: merkost Date: Fri, 9 Jun 2023 10:52:28 +1000 Subject: [PATCH 38/47] Removed old accessibility functions which caused manual focus clearing --- .../keyboard/views/MyKeyboardView.kt | 59 ++----------------- 1 file changed, 4 insertions(+), 55 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt b/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt index 43bddfd..38f1923 100644 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt @@ -17,8 +17,6 @@ import android.os.Message import android.util.AttributeSet import android.util.TypedValue import android.view.* -import android.view.accessibility.AccessibilityEvent -import android.view.accessibility.AccessibilityManager import android.view.animation.AccelerateInterpolator import android.view.inputmethod.EditorInfo import android.widget.PopupWindow @@ -57,8 +55,7 @@ import kotlinx.android.synthetic.main.keyboard_view_keyboard.view.* import java.util.* @SuppressLint("UseCompatLoadingForDrawables", "ClickableViewAccessibility") -class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: AttributeSet?, defStyleRes: Int = 0) : - View(context, attrs, defStyleRes) { +class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: AttributeSet?, defStyleRes: Int = 0) : View(context, attrs, defStyleRes) { override fun dispatchHoverEvent(event: MotionEvent): Boolean { return if (accessHelper.dispatchHoverEvent(event)) { @@ -225,9 +222,6 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut /** The canvas for the above mutable keyboard bitmap */ private var mCanvas: Canvas? = null - /** The accessibility manager for accessibility support */ - private val mAccessibilityManager: AccessibilityManager - private var mHandler: Handler? = null companion object { @@ -286,7 +280,6 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut mPaint.textAlign = Align.CENTER mPaint.alpha = 255 mMiniKeyboardCache = HashMap() - mAccessibilityManager = (context.getSystemService(Context.ACCESSIBILITY_SERVICE) as AccessibilityManager) mPopupMaxMoveDistance = resources.getDimension(R.dimen.popup_max_move_distance) mTopSmallNumberSize = resources.getDimension(R.dimen.small_text_size) mTopSmallNumberMarginWidth = resources.getDimension(R.dimen.top_small_number_margin_width) @@ -685,10 +678,7 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut val secondaryIconBottom = secondaryIconTop + secondaryIconHeight secondaryIcon.setBounds( - secondaryIconLeft, - secondaryIconTop, - secondaryIconRight, - secondaryIconBottom + secondaryIconLeft, secondaryIconTop, secondaryIconRight, secondaryIconBottom ) secondaryIcon.draw(canvas) @@ -874,29 +864,6 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut val oldKeyIndex = mCurrentKeyIndex val previewPopup = mPreviewPopup mCurrentKeyIndex = keyIndex - // Release the old key and press the new key - val keys = mKeys - if (oldKeyIndex != mCurrentKeyIndex) { - if (oldKeyIndex != NOT_A_KEY && keys.size > oldKeyIndex) { - val oldKey = keys[oldKeyIndex] - oldKey.pressed = false - invalidateKey(oldKeyIndex) - val keyCode = oldKey.code - sendAccessibilityEventForUnicodeCharacter(AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED, keyCode) - } - - if (mCurrentKeyIndex != NOT_A_KEY && keys.size > mCurrentKeyIndex) { - val newKey = keys[mCurrentKeyIndex] - - val code = newKey.code - if (context.config.showKeyBorders || (code == KEYCODE_SHIFT || code == KEYCODE_MODE_CHANGE || code == KEYCODE_DELETE || code == KEYCODE_ENTER || code == KEYCODE_SPACE)) { - newKey.pressed = true - } - - invalidateKey(mCurrentKeyIndex) - sendAccessibilityEventForUnicodeCharacter(AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED, code) - } - } if (!context.config.showPopupOnKeypress) { return @@ -907,8 +874,7 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut if (previewPopup.isShowing) { if (keyIndex == NOT_A_KEY) { mHandler!!.sendMessageDelayed( - mHandler!!.obtainMessage(MSG_REMOVE_PREVIEW), - DELAY_AFTER_PREVIEW.toLong() + mHandler!!.obtainMessage(MSG_REMOVE_PREVIEW), DELAY_AFTER_PREVIEW.toLong() ) } } @@ -1001,22 +967,6 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut } } - private fun sendAccessibilityEventForUnicodeCharacter(eventType: Int, code: Int) { - if (mAccessibilityManager.isEnabled) { - val event = AccessibilityEvent.obtain(eventType) - onInitializeAccessibilityEvent(event) - val text: String = when (code) { - KEYCODE_DELETE -> context.getString(R.string.keycode_delete) - KEYCODE_ENTER -> context.getString(R.string.keycode_enter) - KEYCODE_MODE_CHANGE -> context.getString(R.string.keycode_mode_change) - KEYCODE_SHIFT -> context.getString(R.string.keycode_shift) - else -> code.toChar().toString() - } - event.text.add(text) - mAccessibilityManager.sendAccessibilityEvent(event) - } - } - /** * Requests a redraw of the entire keyboard. Calling [.invalidate] is not sufficient because the keyboard renders the keys to an off-screen buffer and * an invalidate() only draws the cached buffer. @@ -1131,8 +1081,7 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut mMiniKeyboard!!.setKeyboard(keyboard) mPopupParent = this mMiniKeyboardContainer!!.measure( - MeasureSpec.makeMeasureSpec(width, MeasureSpec.AT_MOST), - MeasureSpec.makeMeasureSpec(height, MeasureSpec.AT_MOST) + MeasureSpec.makeMeasureSpec(width, MeasureSpec.AT_MOST), MeasureSpec.makeMeasureSpec(height, MeasureSpec.AT_MOST) ) mMiniKeyboardCache[popupKey] = mMiniKeyboardContainer } else { From e6a22e59209f11d2d0b69f26130cad7b881214a6 Mon Sep 17 00:00:00 2001 From: merkost Date: Fri, 9 Jun 2023 11:40:41 +1000 Subject: [PATCH 39/47] Moved AccessHelper to an outer class --- .../keyboard/helpers/AccessHelper.kt | 68 ++++++++++++++++ .../keyboard/helpers/MyKeyboard.kt | 2 +- .../keyboard/views/MyKeyboardView.kt | 77 ++----------------- 3 files changed, 75 insertions(+), 72 deletions(-) create mode 100644 app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/AccessHelper.kt diff --git a/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/AccessHelper.kt b/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/AccessHelper.kt new file mode 100644 index 0000000..120432c --- /dev/null +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/AccessHelper.kt @@ -0,0 +1,68 @@ +package com.simplemobiletools.keyboard.helpers + +import android.graphics.Rect +import android.os.Bundle +import androidx.core.view.accessibility.AccessibilityNodeInfoCompat +import androidx.customview.widget.ExploreByTouchHelper +import com.simplemobiletools.keyboard.views.MyKeyboardView + +class AccessHelper( + private val keyboardView: MyKeyboardView, + private val keys: List +) : ExploreByTouchHelper(keyboardView) { + + /** + * We need to populate the list with the IDs of all of the visible virtual views (the intervals in the chart). + * In our case, all keys are always visible, so we’ll return a list of all IDs. + */ + override fun getVisibleVirtualViews(virtualViewIds: MutableList) { + val keysSize = keys.size + for (i in 0 until keysSize) { + virtualViewIds.add(i) + } + } + + /** + * For this function, we need to return the ID of the virtual view that’s under the x, y position, + * or ExploreByTouchHelper.HOST_ID if there’s no item at those coordinates. + */ + override fun getVirtualViewAt(x: Float, y: Float): Int { + val rects = keys.map { + Rect(it.x, it.y, it.x + it.width, it.y + it.height) + } + rects.firstOrNull { it.contains(x.toInt(), y.toInt()) }?.let { exactRect -> + return rects.indexOf(exactRect) + } ?: return HOST_ID + } + + /** + * This is where we provide all the metadata for our virtual view. + * We need to set the content description (or text, if it’s presented visually) and set the bounds in parent. + */ + override fun onPopulateNodeForVirtualView(virtualViewId: Int, node: AccessibilityNodeInfoCompat) { + node.className = keyboardView::class.simpleName + val key = keys.getOrNull(virtualViewId) + node.contentDescription = key?.getContentDescription(keyboardView.context) ?: "" + val bounds = updateBoundsForInterval(virtualViewId) + node.setBoundsInParent(bounds) + } + + /** + * We need to set the content description (or text, if it’s presented visually) and set the bounds in parent. + * The bounds in the parent should match the logic in the onDraw() function. + */ + private fun updateBoundsForInterval(index: Int): Rect { + val keys = keys + val key = keys.getOrNull(index) ?: return Rect() + return Rect().apply { + left = key.x + top = key.y + right = key.x + key.width + bottom = key.y + key.height + } + } + + override fun onPerformActionForVirtualView(virtualViewId: Int, action: Int, arguments: Bundle?): Boolean { + return false + } +} diff --git a/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/MyKeyboard.kt b/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/MyKeyboard.kt index 24f3198..ccba189 100644 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/MyKeyboard.kt +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/MyKeyboard.kt @@ -43,7 +43,7 @@ class MyKeyboard { var mMinWidth = 0 /** List of keys in this keyboard */ - var mKeys: MutableList? = null + var mKeys: MutableList? = null /** Width of the screen available to fit the keyboard */ private var mDisplayWidth = 0 diff --git a/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt b/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt index 38f1923..19c81d3 100644 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt @@ -10,7 +10,6 @@ import android.content.Intent import android.graphics.* import android.graphics.Paint.Align import android.graphics.drawable.* -import android.os.Bundle import android.os.Handler import android.os.Looper import android.os.Message @@ -24,8 +23,6 @@ import android.widget.TextView import androidx.core.animation.doOnEnd import androidx.core.animation.doOnStart import androidx.core.view.ViewCompat -import androidx.core.view.accessibility.AccessibilityNodeInfoCompat -import androidx.customview.widget.ExploreByTouchHelper import androidx.emoji2.text.EmojiCompat import androidx.emoji2.text.EmojiCompat.EMOJI_SUPPORTED import com.simplemobiletools.commons.extensions.* @@ -58,80 +55,14 @@ import java.util.* class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: AttributeSet?, defStyleRes: Int = 0) : View(context, attrs, defStyleRes) { override fun dispatchHoverEvent(event: MotionEvent): Boolean { - return if (accessHelper.dispatchHoverEvent(event)) { + return if (accessHelper?.dispatchHoverEvent(event) == true) { true } else { super.dispatchHoverEvent(event) } } - private val accessHelper = AccessHelper() - - inner class AccessHelper() : ExploreByTouchHelper(this) { - - /** - * We need to populate the list with the IDs of all of the visible virtual views (the intervals in the chart). - * In our case, all keys are always visible, so we’ll return a list of all IDs. - */ - override fun getVisibleVirtualViews(virtualViewIds: MutableList) { - val keysSize = mKeyboard?.mKeys?.size ?: 0 - for (i in 0 until keysSize) { - virtualViewIds.add(i) - } - } - - /** - * For this function, we need to return the ID of the virtual view that’s under the x, y position, - * or ExploreByTouchHelper.HOST_ID if there’s no item at those coordinates. - */ - override fun getVirtualViewAt(x: Float, y: Float): Int { - mKeyboard?.mKeys?.filterNotNull()?.let { keyList -> - val rects = keyList.map { - Rect(it.x, it.y, it.x + it.width, it.y + it.height) - } - rects.firstOrNull { it.contains(x.toInt(), y.toInt()) }?.let { exactRect -> - val exactIndexKey = rects.indexOf(exactRect) - return exactIndexKey - } ?: return HOST_ID - } - return HOST_ID - } - - /** - * This is where we provide all the metadata for our virtual view. - * We need to set the content description (or text, if it’s presented visually) and set the bounds in parent. - */ - override fun onPopulateNodeForVirtualView(virtualViewId: Int, node: AccessibilityNodeInfoCompat) { - node.className = MyKeyboardView::class.simpleName - val key = mKeyboard?.mKeys?.get(virtualViewId) - node.contentDescription = key?.getContentDescription(context) - val bounds = updateBoundsForInterval(virtualViewId) - node.setBoundsInParent(bounds) - } - - /** - * We need to set the content description (or text, if it’s presented visually) and set the bounds in parent. - * The bounds in the parent should match the logic in the onDraw() function. - */ - private fun updateBoundsForInterval(index: Int): Rect { - val keys = mKeyboard?.mKeys ?: return Rect() - val key = keys[index]!! - return Rect().apply { - left = key.x - top = key.y - right = key.x + key.width - bottom = key.y + key.height - } - } - - override fun onPerformActionForVirtualView(virtualViewId: Int, action: Int, arguments: Bundle?): Boolean { - return false - } - } - - init { - ViewCompat.setAccessibilityDelegate(this, accessHelper) - } + private var accessHelper: AccessHelper? = null private var mKeyboard: MyKeyboard? = null private var mCurrentKeyIndex: Int = NOT_A_KEY @@ -335,6 +266,10 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut invalidateAllKeys() computeProximityThreshold(keyboard) mMiniKeyboardCache.clear() + + accessHelper = AccessHelper(this, mKeyboard?.mKeys.orEmpty()) + ViewCompat.setAccessibilityDelegate(this, accessHelper) + // Not really necessary to do every time, but will free up views // Switching to a different keyboard should abort any pending keys so that the key up // doesn't get delivered to the old or new keyboard From 09bc110eb6b49980419bcd3debdec99b1191ba44 Mon Sep 17 00:00:00 2001 From: merkost Date: Fri, 9 Jun 2023 12:10:00 +1000 Subject: [PATCH 40/47] Fixed a bug when clicking on layout change and space at the same time --- .../com/simplemobiletools/keyboard/views/MyKeyboardView.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt b/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt index 76b4125..5e969c2 100644 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt @@ -1154,8 +1154,8 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut // fix a glitch with long pressing backspace, then clicking some letter if (mRepeatKeyIndex != NOT_A_KEY) { - val key = mKeys[mRepeatKeyIndex] - if (key.code == KEYCODE_DELETE) { + val key = mKeys.getOrNull(mRepeatKeyIndex) + if (key?.code == KEYCODE_DELETE) { mHandler?.removeMessages(MSG_REPEAT) mRepeatKeyIndex = NOT_A_KEY } From 56d3ff4b85fb1562920146468b17337f7f0e7977 Mon Sep 17 00:00:00 2001 From: merkost Date: Fri, 9 Jun 2023 12:22:38 +1000 Subject: [PATCH 41/47] Fixed a bug when some keyboard's change layout button doesn't work as expected --- .../com/simplemobiletools/keyboard/views/MyKeyboardView.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt b/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt index 5e969c2..9525d3a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt @@ -1390,12 +1390,15 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut } showPreview(NOT_A_KEY) Arrays.fill(mKeyIndices, NOT_A_KEY) + + val currentKeyCode = mKeys.getOrNull(mCurrentKey)?.code + // If we're not on a repeating key (which sends on a DOWN event) if (mRepeatKeyIndex == NOT_A_KEY && !mMiniKeyboardOnScreen && !mAbortKey) { detectAndSendKey(mCurrentKey, touchX, touchY, eventTime) } - if (mKeys.getOrNull(mCurrentKey)?.code == KEYCODE_SPACE && !mIsLongPressingSpace) { + if (currentKeyCode == KEYCODE_SPACE && !mIsLongPressingSpace) { detectAndSendKey(mCurrentKey, touchX, touchY, eventTime) } From c2d17f5c3a99493934774cf267858bc7bb87e0d3 Mon Sep 17 00:00:00 2001 From: merkost Date: Sat, 10 Jun 2023 11:33:48 +1000 Subject: [PATCH 42/47] Created keycode_space resource in any translation and changed to Spacebar --- app/src/main/res/values-ar/strings.xml | 1 + app/src/main/res/values-be/strings.xml | 1 + app/src/main/res/values-bg/strings.xml | 1 + app/src/main/res/values-ca/strings.xml | 1 + app/src/main/res/values-ckb/strings.xml | 1 + app/src/main/res/values-cs/strings.xml | 3 ++- app/src/main/res/values-da/strings.xml | 1 + app/src/main/res/values-de/strings.xml | 1 + app/src/main/res/values-el/strings.xml | 1 + app/src/main/res/values-eo/strings.xml | 1 + app/src/main/res/values-es/strings.xml | 3 ++- app/src/main/res/values-et/strings.xml | 3 ++- app/src/main/res/values-fi/strings.xml | 1 + app/src/main/res/values-fr/strings.xml | 1 + app/src/main/res/values-gl/strings.xml | 1 + app/src/main/res/values-hr/strings.xml | 1 + app/src/main/res/values-hu/strings.xml | 1 + app/src/main/res/values-in/strings.xml | 1 + app/src/main/res/values-it/strings.xml | 1 + app/src/main/res/values-iw/strings.xml | 1 + app/src/main/res/values-ja/strings.xml | 1 + app/src/main/res/values-lt/strings.xml | 1 + app/src/main/res/values-ml/strings.xml | 1 + app/src/main/res/values-nb-rNO/strings.xml | 1 + app/src/main/res/values-nl/strings.xml | 1 + app/src/main/res/values-pa-rPK/strings.xml | 1 + app/src/main/res/values-pa/strings.xml | 1 + app/src/main/res/values-pl/strings.xml | 1 + app/src/main/res/values-pt-rBR/strings.xml | 1 + app/src/main/res/values-pt/strings.xml | 3 ++- app/src/main/res/values-ro/strings.xml | 1 + app/src/main/res/values-sk/strings.xml | 1 + app/src/main/res/values-sl/strings.xml | 1 + app/src/main/res/values-sr/strings.xml | 1 + app/src/main/res/values-sv/strings.xml | 3 ++- app/src/main/res/values-th/strings.xml | 1 + app/src/main/res/values-tr/strings.xml | 1 + app/src/main/res/values-uk/strings.xml | 1 + app/src/main/res/values-zh-rCN/strings.xml | 1 + app/src/main/res/values-zh-rTW/strings.xml | 1 + app/src/main/res/values/strings.xml | 2 +- 41 files changed, 46 insertions(+), 6 deletions(-) diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index 385f894..77702f3 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -26,6 +26,7 @@ تغيير نوع لوحة المفاتيح Shift Enter + Spacebar إظهار محتوى الحافظة إذا كان متوفرا إظهار نافذة منبثقة عند الضغط على المفاتيح diff --git a/app/src/main/res/values-be/strings.xml b/app/src/main/res/values-be/strings.xml index 8b584fb..0a4c7f1 100644 --- a/app/src/main/res/values-be/strings.xml +++ b/app/src/main/res/values-be/strings.xml @@ -26,6 +26,7 @@ Змяніць тып клавіятуры Зрух Увайдзіце + Spacebar Паказаць змесціва буфера абмену, калі яно даступна Паказваць усплывальнае акно пры націску клавішы diff --git a/app/src/main/res/values-bg/strings.xml b/app/src/main/res/values-bg/strings.xml index cc35140..79c7c52 100644 --- a/app/src/main/res/values-bg/strings.xml +++ b/app/src/main/res/values-bg/strings.xml @@ -26,6 +26,7 @@ Промяна на типа клавиатура Shift Enter + Spacebar Показване на клипборд съдържанието, ако е налично Показване на изскачащ прозорец при натискане на клавиш diff --git a/app/src/main/res/values-ca/strings.xml b/app/src/main/res/values-ca/strings.xml index 5cb2829..4bf9824 100644 --- a/app/src/main/res/values-ca/strings.xml +++ b/app/src/main/res/values-ca/strings.xml @@ -26,6 +26,7 @@ Canvia el tipus de teclat Majúscules Retorn + Spacebar Mostra el contingut del porta-retalls si està disponible Mostra una finestra emergent en prémer les tecles diff --git a/app/src/main/res/values-ckb/strings.xml b/app/src/main/res/values-ckb/strings.xml index 9499346..a7786e8 100644 --- a/app/src/main/res/values-ckb/strings.xml +++ b/app/src/main/res/values-ckb/strings.xml @@ -26,6 +26,7 @@ گۆڕینی شێواز شێفت ئینتەر + Spacebar پیشاندانی دوایین لەبەرگیراوە بچووککراوەی پیت diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index cb2859f..0a89ba5 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -26,6 +26,7 @@ Změnit typ klávesnice Shift Enter + Spacebar Zobrazit obsah schránky, pokud je k dispozici Zobrazit vyskakovací okno při stisknutí klávesy @@ -41,4 +42,4 @@ Haven't found some strings? There's more at https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res --> - \ No newline at end of file + diff --git a/app/src/main/res/values-da/strings.xml b/app/src/main/res/values-da/strings.xml index 3fbab32..c9cb548 100644 --- a/app/src/main/res/values-da/strings.xml +++ b/app/src/main/res/values-da/strings.xml @@ -26,6 +26,7 @@ Skift tastaturtype Shift Enter + Spacebar Vis indhold i udklipsholder, hvis det er tilgængeligt Vis en popup ved tastetryk diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 6c2fd98..7c2f78f 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -26,6 +26,7 @@ Tastaturtyp ändern Umschalttaste Eingabe + Spacebar Inhalt der Zwischenablage anzeigen, falls vorhanden Bei Tastendruck ein Popup anzeigen diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index 830ca70..2401ecf 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -26,6 +26,7 @@ Αλλαγή τύπου πληκτρολογίου Shift Enter + Spacebar Εμφάνιση περιεχομένου πρόχειρου εάν είναι διαθέσιμο Εμφάνιση ανάδυσης στο πάτημα πλήκτρων diff --git a/app/src/main/res/values-eo/strings.xml b/app/src/main/res/values-eo/strings.xml index 14ce48a..ee13235 100644 --- a/app/src/main/res/values-eo/strings.xml +++ b/app/src/main/res/values-eo/strings.xml @@ -26,6 +26,7 @@ Change keyboard type Shift Enter + Spacebar Show clipboard content if available Show a popup on keypress diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 15b852c..93ba931 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -26,6 +26,7 @@ Cambiar el tipo de teclado Shift Enter + Spacebar Mostrar el contenido del portapapeles si está disponible Mostrar una ventana emergente al pulsar una tecla @@ -41,4 +42,4 @@ Haven't found some strings? There's more at https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res --> - \ No newline at end of file + diff --git a/app/src/main/res/values-et/strings.xml b/app/src/main/res/values-et/strings.xml index 34b5bbf..706b355 100644 --- a/app/src/main/res/values-et/strings.xml +++ b/app/src/main/res/values-et/strings.xml @@ -26,6 +26,7 @@ Muuda klaviatuuri tüüpi Shift Sisenema + Spacebar Näita lõikelaua kirjeid Klahvivajutusel näita hüpikakent @@ -41,4 +42,4 @@ Haven't found some strings? There's more at https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res --> - \ No newline at end of file + diff --git a/app/src/main/res/values-fi/strings.xml b/app/src/main/res/values-fi/strings.xml index f934aac..58f89ba 100644 --- a/app/src/main/res/values-fi/strings.xml +++ b/app/src/main/res/values-fi/strings.xml @@ -26,6 +26,7 @@ Vaihda näppäimistön tyyppi Shift Enter + Spacebar Näytä leikepöydän sisältö, jos saatavilla Näytä ponnahdus näppäinten painalluksesta diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index b6d1b0f..13eebd6 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -26,6 +26,7 @@ Changer de type de clavier Majuscule Entrée + Spacebar Afficher le contenu du presse-papiers si disponible Afficher une fenêtre contextuelle en cas de pression sur une touche diff --git a/app/src/main/res/values-gl/strings.xml b/app/src/main/res/values-gl/strings.xml index 9446f78..659fc24 100644 --- a/app/src/main/res/values-gl/strings.xml +++ b/app/src/main/res/values-gl/strings.xml @@ -26,6 +26,7 @@ Cambialo tipo do teclado Shift Enter + Spacebar Mostralo contido do portapapeis se atopase dispoñible Mostra unha ventá emerxente ao premer nunha tecla diff --git a/app/src/main/res/values-hr/strings.xml b/app/src/main/res/values-hr/strings.xml index 592ec63..4406b93 100644 --- a/app/src/main/res/values-hr/strings.xml +++ b/app/src/main/res/values-hr/strings.xml @@ -26,6 +26,7 @@ Promijeni vrstu tipkovnice Shift Enter + Spacebar Prikaži sadržaj međuspremnika ako postoji Prikaži skočni prozor prilikom pritiskanja tipke diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index e1821df..fb77295 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -26,6 +26,7 @@ Billentyűzet típusának módosítása Váltás Enter + Spacebar Vágólap tartalmának megjelenítése, ha rendelkezésre áll Felugró ablak megjelenítése billentyűleütéskor diff --git a/app/src/main/res/values-in/strings.xml b/app/src/main/res/values-in/strings.xml index 705987e..fae512a 100644 --- a/app/src/main/res/values-in/strings.xml +++ b/app/src/main/res/values-in/strings.xml @@ -26,6 +26,7 @@ Ubah tipe keyboard Shift Enter + Spacebar Tampilkan konten papan klip jika tersedia Tampilkan sebuah popup pada penekanan tombol diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 267b3d6..28cf1c3 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -26,6 +26,7 @@ Cambia il tipo di tastiera Maiusc Invio + Spacebar Mostra il contenuto degli appunti se disponibile Mostra un popup alla pressione di un tasto diff --git a/app/src/main/res/values-iw/strings.xml b/app/src/main/res/values-iw/strings.xml index e7a984c..1a5bbad 100644 --- a/app/src/main/res/values-iw/strings.xml +++ b/app/src/main/res/values-iw/strings.xml @@ -26,6 +26,7 @@ שנה את סוג המקלדת Shift Enter + Spacebar הצג תוכן של לוח אם זמין הצג חלון קופץ בלחיצת מקש diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index b2edb3c..c0b72fb 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -26,6 +26,7 @@ キーボードの種類を変更する シフト エンター + Spacebar クリップボードの内容がある場合、それを表示する キー入力時にポップアップを表示する diff --git a/app/src/main/res/values-lt/strings.xml b/app/src/main/res/values-lt/strings.xml index ae49ca6..a89afdb 100644 --- a/app/src/main/res/values-lt/strings.xml +++ b/app/src/main/res/values-lt/strings.xml @@ -26,6 +26,7 @@ Keisti klaviatūros tipą Shift Enter + Spacebar Jei prieinama, rodyti iškarpinės turinį Show a popup on keypress diff --git a/app/src/main/res/values-ml/strings.xml b/app/src/main/res/values-ml/strings.xml index 8df0fe8..102038a 100644 --- a/app/src/main/res/values-ml/strings.xml +++ b/app/src/main/res/values-ml/strings.xml @@ -26,6 +26,7 @@ കീബോർഡ് തരം മാറ്റുക ഷിഫ്റ്റ് നൽകുക + Spacebar ക്ലിപ്പ്ബോർഡ് ഉള്ളടക്കം ലഭ്യമാണെങ്കിൽ കാണിക്കുക കീപ്രസ്സിൽ ഒരു പോപ്പ്അപ്പ് കാണിക്കുക diff --git a/app/src/main/res/values-nb-rNO/strings.xml b/app/src/main/res/values-nb-rNO/strings.xml index 14ce48a..ee13235 100644 --- a/app/src/main/res/values-nb-rNO/strings.xml +++ b/app/src/main/res/values-nb-rNO/strings.xml @@ -26,6 +26,7 @@ Change keyboard type Shift Enter + Spacebar Show clipboard content if available Show a popup on keypress diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 95f68fb..344c01b 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -26,6 +26,7 @@ Type toetsenbord veranderen Shift Enter + Spacebar Klembordinhoud tonen indien beschikbaar Pop-up tonen bij toetsaanslagen diff --git a/app/src/main/res/values-pa-rPK/strings.xml b/app/src/main/res/values-pa-rPK/strings.xml index 4860f70..3bf51be 100644 --- a/app/src/main/res/values-pa-rPK/strings.xml +++ b/app/src/main/res/values-pa-rPK/strings.xml @@ -26,6 +26,7 @@ کیبورڈ دی قسم بدلو Shift Enter + Spacebar جے اُپلبدھ ہووے تاں کاپی کیتی لکھت ویکھو جدوں کنجی دباؤݨ کنجی تے وڈا اکھر ویکھو diff --git a/app/src/main/res/values-pa/strings.xml b/app/src/main/res/values-pa/strings.xml index 47e09d3..8aab64e 100644 --- a/app/src/main/res/values-pa/strings.xml +++ b/app/src/main/res/values-pa/strings.xml @@ -26,6 +26,7 @@ Change keyboard type Shift Enter + Spacebar Show clipboard content if available Show a popup on keypress diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index ff6fedd..bc11a37 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -26,6 +26,7 @@ Zmień typ klawiatury Shift Enter + Spacebar Pokazuj zawartość schowka, jeśli jest dostępna Pokazuj wyskakujące okienko przy naciśnięciu klawisza diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index ee694ef..232e079 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -26,6 +26,7 @@ Mudar tipo de teclado Shift Enter + Spacebar Mostrar conteúdo da área de transferência se houver Mostrar pop-up ao digitar diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index a031e0d..cf99140 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -26,6 +26,7 @@ Alterar tipo de teclado Shift Enter + Spacebar Mostrar conteúdo da área de transferência, se disponível Mostrar pop-up ao premir as teclas @@ -41,4 +42,4 @@ Haven't found some strings? There's more at https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res --> - \ No newline at end of file + diff --git a/app/src/main/res/values-ro/strings.xml b/app/src/main/res/values-ro/strings.xml index 410545a..7d76106 100644 --- a/app/src/main/res/values-ro/strings.xml +++ b/app/src/main/res/values-ro/strings.xml @@ -26,6 +26,7 @@ Schimbați tipul de tastatură Shift Enter + Spacebar Afișează conținutul clipboard-ului, dacă este disponibil Afișați o fereastră pop-up la apăsarea unei taste diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index 6332031..45ac58c 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -26,6 +26,7 @@ Zmeniť typ klávesnice Shift Enter + Spacebar Zobraziť obsah schránky, ak je dostupná Zobraziť detail znaku pri stlačení diff --git a/app/src/main/res/values-sl/strings.xml b/app/src/main/res/values-sl/strings.xml index f4838c0..33b27c7 100644 --- a/app/src/main/res/values-sl/strings.xml +++ b/app/src/main/res/values-sl/strings.xml @@ -26,6 +26,7 @@ Spremeni vrsto tipkovnice Shift Enter + Spacebar Prikaži vsebino odložišča, če je na voljo Prikaži pojavno okno ob pritisku tipke diff --git a/app/src/main/res/values-sr/strings.xml b/app/src/main/res/values-sr/strings.xml index 1a790f3..c2d89ed 100644 --- a/app/src/main/res/values-sr/strings.xml +++ b/app/src/main/res/values-sr/strings.xml @@ -26,6 +26,7 @@ Промените тип тастатуре Смена Унеси + Spacebar Прикажи садржај међуспремника ако је доступан Прикажи искачући прозор при притиску на тастер diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 1d71125..9454853 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -26,6 +26,7 @@ Ändra tangentbordstyp Skift Enter + Spacebar Visa urklippets innehåll om tillgängligt Visa en popupp vid knapptryck @@ -41,4 +42,4 @@ Haven't found some strings? There's more at https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res --> - \ No newline at end of file + diff --git a/app/src/main/res/values-th/strings.xml b/app/src/main/res/values-th/strings.xml index 14ce48a..ee13235 100644 --- a/app/src/main/res/values-th/strings.xml +++ b/app/src/main/res/values-th/strings.xml @@ -26,6 +26,7 @@ Change keyboard type Shift Enter + Spacebar Show clipboard content if available Show a popup on keypress diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index d357e48..41b315e 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -26,6 +26,7 @@ Klavye türünü değiştir Shift Enter + Spacebar Varsa pano içeriğini göster Tuşa basıldığında bir açılır menü göster diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml index dc8cb25..9ae5a85 100644 --- a/app/src/main/res/values-uk/strings.xml +++ b/app/src/main/res/values-uk/strings.xml @@ -26,6 +26,7 @@ Змінити тип клавіатури Shift Enter + Spacebar Показувати вміст буфера обміну, якщо він є Показувати popup при натисканні diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index cbc7f2c..8a203f4 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -26,6 +26,7 @@ 更改键盘类型 上档 输入 + Spacebar 如可用显示剪贴板内容 按键时显示弹框 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index f9db284..d099b14 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -27,6 +27,7 @@ 變更鍵盤類型 Shift Enter + Spacebar 可以的話顯示剪貼簿內容 按下按鍵時顯示彈出效果 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index a30eefe..ee13235 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -26,7 +26,7 @@ Change keyboard type Shift Enter - Space + Spacebar Show clipboard content if available Show a popup on keypress From c17a79a7b422da6d4aee03168c57ce623a3c86b1 Mon Sep 17 00:00:00 2001 From: Tibor Kaputa Date: Sat, 10 Jun 2023 09:15:11 +0200 Subject: [PATCH 43/47] shortening some code --- .../keyboard/helpers/MyKeyboard.kt | 34 ++++--------------- 1 file changed, 7 insertions(+), 27 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/MyKeyboard.kt b/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/MyKeyboard.kt index ccba189..fb90bdf 100644 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/MyKeyboard.kt +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/MyKeyboard.kt @@ -230,33 +230,13 @@ class MyKeyboard { */ fun getContentDescription(context: Context): CharSequence { return when (code) { - KEYCODE_SHIFT -> { - context.getString(R.string.keycode_shift) - } - - KEYCODE_MODE_CHANGE -> { - context.getString(R.string.keycode_mode_change) - } - - KEYCODE_ENTER -> { - context.getString(R.string.keycode_enter) - } - - KEYCODE_DELETE -> { - context.getString(R.string.keycode_delete) - } - - KEYCODE_SPACE -> { - context.getString(R.string.keycode_space) - } - - KEYCODE_EMOJI -> { - context.getString(R.string.emojis) - } - - else -> { - label - } + KEYCODE_SHIFT -> context.getString(R.string.keycode_shift) + KEYCODE_MODE_CHANGE -> context.getString(R.string.keycode_mode_change) + KEYCODE_ENTER -> context.getString(R.string.keycode_enter) + KEYCODE_DELETE -> context.getString(R.string.keycode_delete) + KEYCODE_SPACE -> context.getString(R.string.keycode_space) + KEYCODE_EMOJI -> context.getString(R.string.emojis) + else -> label } } From 6a8ff890222231e3b0f1726bd0bda6e855f8b9f3 Mon Sep 17 00:00:00 2001 From: Tibor Kaputa Date: Sat, 10 Jun 2023 09:15:32 +0200 Subject: [PATCH 44/47] minor code style update --- .../com/simplemobiletools/keyboard/helpers/AccessHelper.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/AccessHelper.kt b/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/AccessHelper.kt index 120432c..dd10066 100644 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/AccessHelper.kt +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/AccessHelper.kt @@ -30,9 +30,10 @@ class AccessHelper( val rects = keys.map { Rect(it.x, it.y, it.x + it.width, it.y + it.height) } - rects.firstOrNull { it.contains(x.toInt(), y.toInt()) }?.let { exactRect -> - return rects.indexOf(exactRect) - } ?: return HOST_ID + + return rects.firstOrNull { it.contains(x.toInt(), y.toInt()) }?.let { exactRect -> + rects.indexOf(exactRect) + } ?: HOST_ID } /** From 9519caa01e9a8821baa64427032cc6b25efc68fc Mon Sep 17 00:00:00 2001 From: Tibor Kaputa Date: Sat, 10 Jun 2023 09:17:12 +0200 Subject: [PATCH 45/47] updating the slovak string --- app/src/main/res/values-sk/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index 45ac58c..79dc658 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -26,7 +26,7 @@ Zmeniť typ klávesnice Shift Enter - Spacebar + Medzerník Zobraziť obsah schránky, ak je dostupná Zobraziť detail znaku pri stlačení From 312f65daeabf7c5ebafde14f166426745d92129d Mon Sep 17 00:00:00 2001 From: JdM Date: Sun, 11 Jun 2023 11:40:37 +0000 Subject: [PATCH 46/47] change the top row to select the number by default --- app/src/main/res/xml/keys_letters_french_bepo.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/res/xml/keys_letters_french_bepo.xml b/app/src/main/res/xml/keys_letters_french_bepo.xml index 7534aa7..0df57fb 100644 --- a/app/src/main/res/xml/keys_letters_french_bepo.xml +++ b/app/src/main/res/xml/keys_letters_french_bepo.xml @@ -43,17 +43,17 @@ app:topSmallNumber="1" /> From d3729565400efe489f2ddf74701fbdb3111fb064 Mon Sep 17 00:00:00 2001 From: merkost Date: Tue, 13 Jun 2023 14:19:46 +1000 Subject: [PATCH 47/47] Improved if statements for detectAndSendKey --- .../com/simplemobiletools/keyboard/views/MyKeyboardView.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt b/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt index 9525d3a..7951cbf 100644 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt @@ -1396,9 +1396,7 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut // If we're not on a repeating key (which sends on a DOWN event) if (mRepeatKeyIndex == NOT_A_KEY && !mMiniKeyboardOnScreen && !mAbortKey) { detectAndSendKey(mCurrentKey, touchX, touchY, eventTime) - } - - if (currentKeyCode == KEYCODE_SPACE && !mIsLongPressingSpace) { + } else if (currentKeyCode == KEYCODE_SPACE && !mIsLongPressingSpace) { detectAndSendKey(mCurrentKey, touchX, touchY, eventTime) }