@消息界面删除逻辑补充
This commit is contained in:
parent
e2095f6e46
commit
a6004941ad
@ -37,10 +37,10 @@ public class AtTextWatcher implements TextWatcher {
|
|||||||
int endIndex = startIndex + nameStr.length();//字符结束的位置
|
int endIndex = startIndex + nameStr.length();//字符结束的位置
|
||||||
spanMap.put(model.getId(), model);
|
spanMap.put(model.getId(), model);
|
||||||
//插入要添加的字符,此处是为了给span占位
|
//插入要添加的字符,此处是为了给span占位
|
||||||
input.getText().insert(startIndex, "@" + nameStr + " ");
|
input.getText().insert(startIndex, "@" + nameStr);
|
||||||
//1、使用mEditText构造一个SpannableString
|
//1、使用mEditText构造一个SpannableString
|
||||||
StringBuffer atName = new StringBuffer();
|
StringBuffer atName = new StringBuffer();
|
||||||
atName.append("@").append(nameStr).append(" ");
|
atName.append("@").append(nameStr);
|
||||||
if (spannableStringBuilder.length() > 0) {
|
if (spannableStringBuilder.length() > 0) {
|
||||||
spannableStringBuilder.insert(startIndex, atName.toString());
|
spannableStringBuilder.insert(startIndex, atName.toString());
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user