Skip to content

Commit

Permalink
build: version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
ch4rl3x committed Jan 27, 2022
1 parent 89bf270 commit 5ddcb7c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion html-text/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ apply from: '../buildCompose.gradle'

ext {
PUBLISH_GROUP_ID = 'de.charlex.compose'
PUBLISH_VERSION = '1.0.0'
PUBLISH_VERSION = '1.1.0'
PUBLISH_ARTIFACT_ID = 'html-text'
}

Expand Down
18 changes: 8 additions & 10 deletions html-text/src/main/java/de/charlex/compose/HtmlText.kt
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,10 @@ fun HtmlText(
onTextLayout: (TextLayoutResult) -> Unit = {},
style: TextStyle = LocalTextStyle.current
) {
val annotatedString = if(SDK_INT<24){
val annotatedString = if (SDK_INT <24) {
Html.fromHtml(text)
} else {
Html.fromHtml(text,Html.FROM_HTML_MODE_LEGACY)
Html.fromHtml(text, Html.FROM_HTML_MODE_LEGACY)
}.toAnnotatedString(urlSpanStyle)

val uriHandler = LocalUriHandler.current
Expand Down Expand Up @@ -216,10 +216,12 @@ fun CharSequence.toAnnotatedString(
}
}

fun Spanned.toAnnotatedString(urlSpanStyle: SpanStyle = SpanStyle(
color = Color.Blue,
textDecoration = TextDecoration.Underline
)) : AnnotatedString {
fun Spanned.toAnnotatedString(
urlSpanStyle: SpanStyle = SpanStyle(
color = Color.Blue,
textDecoration = TextDecoration.Underline
)
): AnnotatedString {
return buildAnnotatedString {
append(this@toAnnotatedString.toString())
val urlSpans = getSpans<URLSpan>()
Expand Down Expand Up @@ -253,7 +255,3 @@ fun Spanned.toAnnotatedString(urlSpanStyle: SpanStyle = SpanStyle(
}
}
}




0 comments on commit 5ddcb7c

Please sign in to comment.