Conversation
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
|
APK file: https://www.kaminsky.me/nc-dev/android-artifacts/4297-talk.apk |
|
|
||
| binding.messageText.text = processedMessageText | ||
|
|
||
| val link = SpannableString(processedMessageText) |
There was a problem hiding this comment.
processedMessageText can be mixed text with hyperlinks. So "test http://anysite.com" can't be directly converted to a link but the link has to be extracted and only this should be underlined and clickable.
Otherwise there could be a ActivityNotFoundException if the link is not valid.
There was a problem hiding this comment.
to extract links, code from
will be helpful. This is the code which decides if the *LinkPreviewMessageViewHolder is applied.
There was a problem hiding this comment.
However thinking about that there can be multiple links inside a message this gets more complicated. Then there might have to be more complex logic similar like it's used for the chip mentions:
| app:outcomingTextLinkColor="@color/high_emphasis_text" | ||
| app:outcomingTextSize="@dimen/chat_text_size" | ||
| app:outcomingTimeTextSize="12sp" | ||
| app:textAutoLink="all" |
There was a problem hiding this comment.
removing
app:textAutoLink="all"
works and may be mandatory to fix the bug.
However this will change the behavior of all ChatMessage types and automatic link detection won't work as described in
#3481 (comment)

fix #1789
🚧 TODO
🏁 Checklist
/backport to stable-xx.x