Revert unintentional behavior change for mention spans to use remote usernames (#2408)

This commit is contained in:
Levi Bard 2022-03-30 19:33:31 +02:00 committed by GitHub
parent 71739ba87f
commit ad001d044d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -149,7 +149,7 @@ fun setClickableMentions(view: TextView, mentions: List<Mention>?, listener: Lin
for (mention in mentions) {
val customSpan = getCustomSpanForMentionUrl(mention.url, mention.id, listener)
end += 1 + mention.username.length // length of @ + username
end += 1 + mention.localUsername.length // length of @ + username
flags = getSpanFlags(customSpan)
if (firstMention) {
firstMention = false
@ -160,7 +160,7 @@ fun setClickableMentions(view: TextView, mentions: List<Mention>?, listener: Lin
}
append("@")
append(mention.username)
append(mention.localUsername)
setSpan(customSpan, start, end, flags)
append("\u200B") // same reasoning as in setClickableText
end += 1 // shift position to take the previous character into account