Skip to content

Instantly share code, notes, and snippets.

@burkido
Created March 23, 2024 15:05
Show Gist options
  • Save burkido/825498849b22aa9aff0e4f4fe1d782cf to your computer and use it in GitHub Desktop.
Save burkido/825498849b22aa9aff0e4f4fe1d782cf to your computer and use it in GitHub Desktop.
val annotations = listOf(
StringAnnotation(
tag = stringResource(id = R.string.terms),
annotation = "https://termify.io/terms-and-conditions-generator",
style = SpanStyle(
color = MaterialTheme.colorScheme.primary,
fontSize = MaterialTheme.typography.bodyMedium.fontSize,
fontStyle = MaterialTheme.typography.bodyMedium.fontStyle,
textDecoration = TextDecoration.Underline,
)
),
StringAnnotation(
tag = stringResource(id = R.string.privacy_policy),
annotation = "https://termify.io/privacy-policy-generator",
style = SpanStyle(
color = MaterialTheme.colorScheme.primary,
fontSize = MaterialTheme.typography.bodyMedium.fontSize,
fontStyle = MaterialTheme.typography.bodyMedium.fontStyle,
textDecoration = TextDecoration.Underline,
)
)
)
ClickableLocalizedText(
text = stringResource(id = R.string.agreement_text),
stringsAnnotations = annotations,
onClick = { url ->
// ...
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment