Skip to content

Commit

Permalink
style: fix ktlint
Browse files Browse the repository at this point in the history
  • Loading branch information
ch4rl3x committed Sep 19, 2022
1 parent b59e52e commit a926af4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions html-text/src/main/java/de/charlex/compose/HtmlText.kt
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ fun HtmlText(
) {
val context = LocalContext.current
val annotatedString = context.resources.getText(textId).toAnnotatedString(urlSpanStyle, colorMapping)
val clickable = annotatedString.getStringAnnotations(0, annotatedString.length-1).any { it.tag == "url" }
val clickable = annotatedString.getStringAnnotations(0, annotatedString.length - 1).any { it.tag == "url" }

val uriHandler = LocalUriHandler.current
val layoutResult = remember { mutableStateOf<TextLayoutResult?>(null) }

Text(
modifier = modifier.then(if(clickable) Modifier.pointerInput(Unit) {
modifier = modifier.then(if (clickable) Modifier.pointerInput(Unit) {
detectTapGestures(onTap = { pos ->
layoutResult.value?.let { layoutResult ->
val position = layoutResult.getOffsetForPosition(pos)
Expand Down Expand Up @@ -165,13 +165,13 @@ fun HtmlText(
Html.fromHtml(text, Html.FROM_HTML_MODE_LEGACY)
}.toAnnotatedString(urlSpanStyle, colorMapping)

val clickable = annotatedString.getStringAnnotations(0, annotatedString.length-1).any { it.tag == "url" }
val clickable = annotatedString.getStringAnnotations(0, annotatedString.length - 1).any { it.tag == "url" }

val uriHandler = LocalUriHandler.current
val layoutResult = remember { mutableStateOf<TextLayoutResult?>(null) }

Text(
modifier = modifier.then(if(clickable) Modifier.pointerInput(Unit) {
modifier = modifier.then(if (clickable) Modifier.pointerInput(Unit) {
detectTapGestures(onTap = { pos ->
layoutResult.value?.let { layoutResult ->
val position = layoutResult.getOffsetForPosition(pos)
Expand Down

0 comments on commit a926af4

Please sign in to comment.