From f85d561805db57e86560d8c59bf99b332c572915 Mon Sep 17 00:00:00 2001 From: Fernando Garcia Date: Thu, 19 Dec 2024 17:57:23 +0100 Subject: [PATCH] ANDROID-14792 Update. Support custom link tag according to @jeprubio suggestion --- .../com/telefonica/mistica/compose/input/TextWithLinks.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/src/main/java/com/telefonica/mistica/compose/input/TextWithLinks.kt b/library/src/main/java/com/telefonica/mistica/compose/input/TextWithLinks.kt index 7e86dd8ab..6862a51c4 100644 --- a/library/src/main/java/com/telefonica/mistica/compose/input/TextWithLinks.kt +++ b/library/src/main/java/com/telefonica/mistica/compose/input/TextWithLinks.kt @@ -48,7 +48,7 @@ fun getAnnotatedLinksString( val (linkText, link) = linkEntry withLink( link = LinkAnnotation.Clickable( - tag = TAG, + tag = link.tag, styles = TextLinkStyles(style = SpanStyle(color = highlightColor)), linkInteractionListener = { link.onLinkTapped.invoke() }, ), @@ -63,7 +63,7 @@ fun getAnnotatedLinksString( } } -data class TextLink(val link: String, val onLinkTapped: () -> Unit) +data class TextLink(val link: String, val tag: String = TAG, val onLinkTapped: () -> Unit) private const val TAG = "TextWithLinks"