mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-10-09 23:02:32 +02:00
Fixes website URLs without schema (http://, https://, etc)
This commit is contained in:
@@ -955,7 +955,17 @@ private fun DrawAdditionalInfo(
|
|||||||
|
|
||||||
ClickableText(
|
ClickableText(
|
||||||
text = AnnotatedString(website.removePrefix("https://")),
|
text = AnnotatedString(website.removePrefix("https://")),
|
||||||
onClick = { website.let { runCatching { uri.openUri(it) } } },
|
onClick = {
|
||||||
|
website.let {
|
||||||
|
runCatching {
|
||||||
|
if (it.contains("://")) {
|
||||||
|
uri.openUri(it)
|
||||||
|
} else {
|
||||||
|
uri.openUri("http://$it")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
style = LocalTextStyle.current.copy(color = MaterialTheme.colors.primary),
|
style = LocalTextStyle.current.copy(color = MaterialTheme.colors.primary),
|
||||||
modifier = Modifier.padding(top = 1.dp, bottom = 1.dp, start = 5.dp)
|
modifier = Modifier.padding(top = 1.dp, bottom = 1.dp, start = 5.dp)
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user