mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-28 03:32:15 -05:00
fixed linkifier
This commit is contained in:
parent
a71e3d0653
commit
b085426d22
@ -88,6 +88,12 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie
|
||||
}
|
||||
}
|
||||
};
|
||||
private static final Linkify.MatchFilter WEBURL_MATCH_FILTER = new Linkify.MatchFilter() {
|
||||
@Override
|
||||
public boolean acceptMatch(CharSequence charSequence, int start, int end) {
|
||||
return start < 1 || charSequence.charAt(start-1) != '@';
|
||||
}
|
||||
};
|
||||
|
||||
private ConversationActivity activity;
|
||||
|
||||
@ -442,8 +448,8 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie
|
||||
privateMarkerIndex + 1 + nick.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
}
|
||||
}
|
||||
Linkify.addLinks(body, Patterns.AUTOLINK_WEB_URL, "http", null, WEBURL_TRANSFORM_FILTER);
|
||||
Linkify.addLinks(body, XMPP_PATTERN, "xmpp");
|
||||
Linkify.addLinks(body, Patterns.AUTOLINK_WEB_URL, "http", WEBURL_MATCH_FILTER, WEBURL_TRANSFORM_FILTER);
|
||||
Linkify.addLinks(body, GeoHelper.GEO_URI, "geo");
|
||||
viewHolder.messageBody.setAutoLinkMask(0);
|
||||
viewHolder.messageBody.setText(body);
|
||||
|
Loading…
Reference in New Issue
Block a user