fix: Correct apply setClickableText, prevent spurious underlines (#5)

The previous code was operating on the wrong text, resulting in normal
URL spans (which have an underline) being applied, instead of the
correct spans (which don't).

Fix this by using the correct length.
This commit is contained in:
Nik Clayton 2023-09-05 22:20:28 +02:00 committed by GitHub
parent e6ce86158b
commit ef007fcf23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -68,7 +68,7 @@ fun setClickableText(view: TextView, content: CharSequence, mentions: List<Menti
val spannableContent = markupHiddenUrls(view.context, content)
view.text = spannableContent.apply {
getSpans(0, content.length, URLSpan::class.java).forEach {
getSpans(0, spannableContent.length, URLSpan::class.java).forEach {
setClickableText(it, this, mentions, tags, listener)
}
}