binding.etContent.editDataListener = object : EditDataListener {
override fun onEditAddAt(str: String, start: Int, length: Int) {
//@符号
}
override fun onEditAddHashtag(start: Int) {
//#符号
}
override fun onCloseEdit() {
//结束输入 如:空格、换行等
}
}
//插入话题
binding.etContent.insert(MentionTopic("11", "国庆快乐"))
//插入用户
binding.etContent.insert(MentionUser("22", "王王王"))
binding.etContent.insertConvert(
MentionTopic(
"11",
"国庆快乐",
),
0,
6
)
binding.etContent.insertText("@")
val list = binding.etContent.formatResult.topicList
val list = binding.etContent.formatResult.userList
binding.etContent.topicLength
binding.etContent.userLength
binding.etContent.clear()