@@ -25,7 +25,6 @@ import androidx.compose.ui.text.TextStyle
25
25
import androidx.compose.ui.text.buildAnnotatedString
26
26
import androidx.compose.ui.text.style.TextAlign
27
27
import androidx.compose.ui.text.style.TextOverflow
28
- import androidx.compose.ui.unit.sp
29
28
import com.babylon.wallet.android.R
30
29
import com.babylon.wallet.android.designsystem.theme.RadixTheme
31
30
import com.babylon.wallet.android.presentation.ui.composables.ExpandableText
@@ -266,31 +265,38 @@ fun MetadataValueView(
266
265
maxLines = 2
267
266
)
268
267
269
- MetadataType .Url -> Row (
268
+ MetadataType .Url -> Text (
270
269
modifier = modifier
271
270
.fillMaxWidth()
272
271
.clickable { context.openUrl(metadata.value) },
273
- horizontalArrangement = Arrangement .spacedBy(RadixTheme .dimensions.paddingDefault),
274
- verticalAlignment = Alignment .CenterVertically
275
- ) {
276
- Text (
277
- text = metadata.value,
278
- style = RadixTheme .typography.body1StandaloneLink,
279
- color = RadixTheme .colors.blue1
280
- )
281
- Icon (
282
- painter = painterResource(id = R .drawable.ic_external_link),
283
- contentDescription = null ,
284
- tint = RadixTheme .colors.gray3
285
- )
286
- }
272
+ text = buildAnnotatedString {
273
+ append(metadata.value)
274
+ append(" " )
275
+ appendInlineContent(id = " link_icon" )
276
+ },
277
+ style = RadixTheme .typography.body1StandaloneLink,
278
+ color = RadixTheme .colors.blue1,
279
+ inlineContent = mapOf (" link_icon" to InlineTextContent (
280
+ Placeholder (
281
+ RadixTheme .typography.body1StandaloneLink.fontSize,
282
+ RadixTheme .typography.body1StandaloneLink.fontSize,
283
+ PlaceholderVerticalAlign .TextCenter
284
+ )
285
+ ) {
286
+ Icon (
287
+ painter = painterResource(id = R .drawable.ic_external_link),
288
+ contentDescription = null ,
289
+ tint = color
290
+ )
291
+ })
292
+ )
287
293
}
288
294
}
289
295
}
290
296
291
297
private const val ASSET_METADATA_SHORT_STRING_THRESHOLD = 40
292
298
private val Metadata .isRenderedInNewLine: Boolean
293
299
get() = this is Metadata .Primitive && (
294
- valueType is MetadataType .Url ||
295
- (valueType is MetadataType .String && value.length > ASSET_METADATA_SHORT_STRING_THRESHOLD )
296
- )
300
+ valueType is MetadataType .Url ||
301
+ (valueType is MetadataType .String && value.length > ASSET_METADATA_SHORT_STRING_THRESHOLD )
302
+ )
0 commit comments