mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-25 09:17:44 +00:00
Linkify URLs
This commit is contained in:
parent
c181dfec81
commit
74697b0be7
@ -52,7 +52,8 @@ class LinkPreviewView : LinearLayout {
|
||||
}
|
||||
titleTextView.setTextColor(ResourcesCompat.getColor(resources, textColorID, context.theme))
|
||||
// Body
|
||||
mainLinkPreviewContainer.addView(VisibleMessageContentView.getBodyTextView(context, message))
|
||||
val bodyTextView = VisibleMessageContentView.getBodyTextView(context, message)
|
||||
mainLinkPreviewContainer.addView(bodyTextView)
|
||||
}
|
||||
|
||||
fun recycle() {
|
||||
|
@ -1,7 +1,9 @@
|
||||
package org.thoughtcrime.securesms.conversation.v2.messages
|
||||
|
||||
import android.content.Context
|
||||
import android.content.res.ColorStateList
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.text.util.Linkify
|
||||
import android.util.AttributeSet
|
||||
import android.util.Log
|
||||
import android.util.TypedValue
|
||||
@ -132,6 +134,8 @@ class VisibleMessageContentView : LinearLayout {
|
||||
result.setTextSize(TypedValue.COMPLEX_UNIT_PX, context.resources.getDimension(R.dimen.small_font_size))
|
||||
val color = getTextColor(context, message)
|
||||
result.setTextColor(color)
|
||||
result.setLinkTextColor(color)
|
||||
Linkify.addLinks(result, Linkify.WEB_URLS)
|
||||
return result
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user