compose-richtext
compose-richtext copied to clipboard
Provide a way to have custom link click handling
I want to make clicking a link give the user the option to copy it to clipboard or open it.
I'm also interested by this, to disable opening links in a certain situation. I would be happy to contribute, but i don't know how to import the library in my project locally.
you might choose the use this (picked from the example folder)
@Composable
fun ProvideToastUriHandler(context: Context, content: @Composable () -> Unit) {
val uriHandler = remember(context) {
object : UriHandler {
override fun openUri(uri: String) {
Toast.makeText(context, uri, Toast.LENGTH_SHORT).show()
}
}
}
CompositionLocalProvider(LocalUriHandler provides uriHandler, content)
}
tho it does not works well for me because i would like to make links just not clickable