Allowing overrides to input method based on package name
This commit is contained in:
parent
980aa88381
commit
e324057de2
@ -215,13 +215,19 @@ class WKT9: InputMethodService(), SpellCheckerSession.SpellCheckerSessionListene
|
|||||||
cursorPosition = attribute?.initialSelEnd ?: 0
|
cursorPosition = attribute?.initialSelEnd ?: 0
|
||||||
// spellCheckerSession = textServiceManager.newSpellCheckerSession(null, locale, this, false)
|
// 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) {
|
when (inputClass) {
|
||||||
InputType.TYPE_CLASS_DATETIME,
|
InputType.TYPE_CLASS_DATETIME,
|
||||||
InputType.TYPE_CLASS_NUMBER,
|
InputType.TYPE_CLASS_NUMBER,
|
||||||
InputType.TYPE_CLASS_PHONE -> enableInputMode(WKT9InputMode.NUMERIC)
|
InputType.TYPE_CLASS_PHONE -> enableInputMode(WKT9InputMode.NUMERIC)
|
||||||
|
|
||||||
InputType.TYPE_CLASS_TEXT -> enableTextInputMode(typeVariation, typeFlags)
|
InputType.TYPE_CLASS_TEXT -> enableTextInputMode(typeVariation, typeFlags)
|
||||||
else -> enableInputMode(WKT9InputMode.IDLE)
|
else -> enableInputMode(WKT9InputMode.IDLE)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
updateInputStatus()
|
updateInputStatus()
|
||||||
|
|
||||||
|
@ -12,4 +12,8 @@
|
|||||||
<string name="preference_setting_whisper_url_key">whisper_url</string>
|
<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_title">Whisper Server URL</string>
|
||||||
<string name="preference_setting_whisper_url_summary">Provide an URL to the Whisper server.</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>
|
</resources>
|
Loading…
x
Reference in New Issue
Block a user