Skip to content

Commit 54ef675

Browse files
committed
add click handling for phone numbers and email addresses
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
1 parent e16adf8 commit 54ef675

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

app/src/main/java/com/nextcloud/talk/ui/chat/MarkdownText.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ private const val CHIP_START_PADDING_DP = 2f
6060
private const val CHIP_END_PADDING_DP = 5f
6161
private const val CHIP_VERTICAL_PADDING_DP = 2f
6262
private const val CHIP_CORNER_RADIUS_DP = 16f
63+
private const val MESSAGE_LINKIFY_MASK = Linkify.WEB_URLS or
64+
Linkify.PHONE_NUMBERS or
65+
Linkify.EMAIL_ADDRESSES
6366

6467
@Suppress("LongMethod", "LongParameterList")
6568
@Composable
@@ -149,7 +152,7 @@ fun MarkdownText(
149152
avatarSizePx = avatarSizePx,
150153
avatarGapPx = avatarGapPx
151154
)
152-
val hasLinks = Linkify.addLinks(ssb, Linkify.WEB_URLS)
155+
val hasLinks = Linkify.addLinks(ssb, MESSAGE_LINKIFY_MASK)
153156
resolveFileParams(ssb, message)
154157
applySearchHighlight(ssb, highlightSearchTerm, searchHighlightColorArgb)
155158
textView.text = ssb

0 commit comments

Comments
 (0)