always use getText().insert for adding pills
This commit is contained in:
parent
3157a35b74
commit
f3db4a857a
|
@ -808,15 +808,14 @@ class MessageComposerFragment : VectorBaseFragment<FragmentComposerBinding>(), A
|
||||||
)
|
)
|
||||||
append(if (startToCompose) ": " else " ")
|
append(if (startToCompose) ": " else " ")
|
||||||
}
|
}
|
||||||
if (startToCompose) {
|
if (startToCompose && displayName.startsWith("/")) {
|
||||||
if (displayName.startsWith("/")) {
|
|
||||||
// Ensure displayName will not be interpreted as a Slash command
|
// Ensure displayName will not be interpreted as a Slash command
|
||||||
composer.editText.append("\\")
|
composer.editText.append("\\")
|
||||||
}
|
}
|
||||||
composer.editText.append(pill)
|
// Always use EditText.getText().insert for adding pills as TextView.append doesn't appear
|
||||||
} else {
|
// to upgrade to BufferType.Spannable as hinted at in the docs:
|
||||||
composer.editText.text?.insert(composer.editText.selectionStart, pill)
|
// https://developer.android.com/reference/android/widget/TextView#append(java.lang.CharSequence)
|
||||||
}
|
composer.editText.text.insert(composer.editText.selectionStart, pill)
|
||||||
}
|
}
|
||||||
focusComposerAndShowKeyboard()
|
focusComposerAndShowKeyboard()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue