ChatMessagesAdapter: fix non-clickable URLs

This commit is contained in:
Alibek Omarov 2020-10-05 23:16:46 +03:00
parent 992f2ec02c
commit 4fa1fb6522

View File

@ -17,6 +17,7 @@ import com.keylesspalace.tusky.util.StatusDisplayOptions
import com.keylesspalace.tusky.util.ThemeUtils
import com.keylesspalace.tusky.util.TimestampUtils
import com.keylesspalace.tusky.util.emojify
import com.keylesspalace.tusky.util.LinkHelper
import com.keylesspalace.tusky.view.MediaPreviewImageView
import com.keylesspalace.tusky.viewdata.ChatMessageViewData
import java.text.SimpleDateFormat
@ -40,8 +41,10 @@ class ChatMessagesViewHolder(view: View) : RecyclerView.ViewHolder(view) {
fun setupWithChatMessage(msg: ChatMessageViewData.Concrete, chatActionListener: ChatActionListener, statusDisplayOptions: StatusDisplayOptions, payload: Any?) {
if(payload == null) {
if(msg.content != null)
content.text = msg.content.emojify(msg.emojis, content)
if(msg.content != null) {
val text = msg.content.emojify(msg.emojis, content)
LinkHelper.setClickableText(content, text, null, chatActionListener)
}
setAttachment(msg.attachment, chatActionListener)
setCreatedAt(msg.createdAt)