Skip to content

Commit

Permalink
优化了文本显示处理(2017-08-22)
Browse files Browse the repository at this point in the history
  • Loading branch information
CarGuo authored Aug 22, 2017
1 parent d7af311 commit abfe5af
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public static Spannable getAtText(Context context, List<UserModel> listUser, Lis
boolean hadHighLine = false;
Map<String, String> map = new HashMap<>();
for (int i = 0; i < listUser.size(); i++) {
int index = content.indexOf(listUser.get(i).getUser_name(), indexStart);
int index = content.indexOf("@" + listUser.get(i).getUser_name(), indexStart) + 1;
if (index < 0 && indexStart > 0) {
index = content.indexOf(listUser.get(i).getUser_name());
if (map.containsKey("" + index)) {
Expand Down Expand Up @@ -194,7 +194,7 @@ public static Spannable getTopicText(Context context, List<TopicModel> listTopic
boolean hadHighLine = false;
Map<String, String> map = new HashMap<>();
for (int i = 0; i < listTopic.size(); i++) {
int index = content.indexOf(listTopic.get(i).getTopicName(), indexStart);
int index = content.indexOf("#" + listTopic.get(i).getTopicName() + "#", indexStart) + 1;
if (index < 0 && indexStart > 0) {
index = content.indexOf(listTopic.get(i).getTopicName());
if (map.containsKey("" + index)) {
Expand Down

0 comments on commit abfe5af

Please sign in to comment.