Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 2 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Thu Jan 13 13:26:27 CET 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
257 changes: 153 additions & 104 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 7 additions & 6 deletions htmlcompose/src/main/java/com/ireward/htmlcompose/HtmlText.kt
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ fun HtmlText(
flags: Int = HtmlCompat.FROM_HTML_MODE_COMPACT,
URLSpanStyle: SpanStyle = SpanStyle(
color = linkTextColor(),
textDecoration = TextDecoration.Underline
)
textDecoration = TextDecoration.Underline,
),
textColor: Color = Color.Black,
) {
val content = text.asHTML(fontSize, flags, URLSpanStyle)
if (linkClicked != null) {
Expand All @@ -62,22 +63,22 @@ fun HtmlText(
softWrap = softWrap,
overflow = overflow,
maxLines = maxLines,
onTextLayout = onTextLayout
onTextLayout = onTextLayout,
color = textColor,
)
}

}

@Composable
private fun linkTextColor() = Color(
TextView(LocalContext.current).linkTextColors.defaultColor
TextView(LocalContext.current).linkTextColors.defaultColor,
)

@Composable
private fun String.asHTML(
fontSize: TextUnit,
flags: Int,
URLSpanStyle: SpanStyle
URLSpanStyle: SpanStyle,
) = buildAnnotatedString {
val spanned = HtmlCompat.fromHtml(this@asHTML, flags)
val spans = spanned.getSpans(0, spanned.length, Any::class.java)
Expand Down