Allowing overrides to input method based on package name

This commit is contained in:
Nehemiah of Zebulun 2023-09-05 14:13:26 +02:00
parent 980aa88381
commit e324057de2
2 changed files with 16 additions and 6 deletions

View File

@ -215,13 +215,19 @@ class WKT9: InputMethodService(), SpellCheckerSession.SpellCheckerSessionListene
cursorPosition = attribute?.initialSelEnd ?: 0
// spellCheckerSession = textServiceManager.newSpellCheckerSession(null, locale, this, false)
val forceNumeric = resources.getStringArray(R.array.input_mode_numeric)
if (forceNumeric.contains(attribute?.packageName)) enableInputMode(WKT9InputMode.NUMERIC)
else {
when (inputClass) {
InputType.TYPE_CLASS_DATETIME,
InputType.TYPE_CLASS_NUMBER,
InputType.TYPE_CLASS_PHONE -> enableInputMode(WKT9InputMode.NUMERIC)
InputType.TYPE_CLASS_TEXT -> enableTextInputMode(typeVariation, typeFlags)
else -> enableInputMode(WKT9InputMode.IDLE)
}
}
updateInputStatus()

View File

@ -12,4 +12,8 @@
<string name="preference_setting_whisper_url_key">whisper_url</string>
<string name="preference_setting_whisper_url_title">Whisper Server URL</string>
<string name="preference_setting_whisper_url_summary">Provide an URL to the Whisper server.</string>
<string-array name="input_mode_numeric">
<item>org.linphone</item>
</string-array>
</resources>