fix: set text before update accessibility node
This commit is contained in:
parent
0a94b7473d
commit
c49853e7b4
@ -452,12 +452,12 @@ class InputService : AccessibilityService() {
|
|||||||
Log.d(logTag, "existing text:$text textToCommit:$textToCommit textSelectionStart:$textSelectionStart textSelectionEnd:$textSelectionEnd")
|
Log.d(logTag, "existing text:$text textToCommit:$textToCommit textSelectionStart:$textSelectionStart textSelectionEnd:$textSelectionEnd")
|
||||||
|
|
||||||
if (textToCommit != null) {
|
if (textToCommit != null) {
|
||||||
var newText = ""
|
|
||||||
|
|
||||||
if ((textSelectionStart == -1) || (textSelectionEnd == -1)) {
|
if ((textSelectionStart == -1) || (textSelectionEnd == -1)) {
|
||||||
newText = textToCommit
|
val newText = textToCommit
|
||||||
|
this.fakeEditTextForTextStateCalculation?.setText(newText)
|
||||||
success = updateTextForAccessibilityNode(node)
|
success = updateTextForAccessibilityNode(node)
|
||||||
} else if (text != null) {
|
} else if (text != null) {
|
||||||
|
this.fakeEditTextForTextStateCalculation?.setText(text)
|
||||||
this.fakeEditTextForTextStateCalculation?.text?.insert(textSelectionStart, textToCommit)
|
this.fakeEditTextForTextStateCalculation?.text?.insert(textSelectionStart, textToCommit)
|
||||||
success = updateTextAndSelectionForAccessibiltyNode(node)
|
success = updateTextAndSelectionForAccessibiltyNode(node)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user