mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-17 20:40:07 +03:00
Adding trailing space " " or ": " if the user started a sentence by mentioning someone,
This commit is contained in:
parent
3a387c5e32
commit
506dfe5fea
1 changed files with 10 additions and 2 deletions
|
@ -220,8 +220,16 @@ class AutoCompleter @AssistedInject constructor(
|
|||
// Replace the word by its completion
|
||||
val displayName = matrixItem.getBestName()
|
||||
|
||||
// with a trailing space
|
||||
editable.replace(startIndex, endIndex, "$displayName ")
|
||||
|
||||
// Adding trailing space " " or ": " if the user started mention someone
|
||||
val displayNameSuffix =
|
||||
if (firstChar == "@" && editText.length() == 1) {
|
||||
": "
|
||||
} else {
|
||||
" "
|
||||
}
|
||||
|
||||
editable.replace(startIndex, endIndex, "$displayName$displayNameSuffix")
|
||||
|
||||
// Add the span
|
||||
val span = PillImageSpan(
|
||||
|
|
Loading…
Add table
Reference in a new issue