Skip to content

Commit 4a0805e

Browse files
committed
Keep original text color on spannable links
1 parent 062c67b commit 4a0805e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

app/src/main/java/com/duckduckgo/app/browser/webview/MaliciousSiteBlockedWarningLayout.kt

+6
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package com.duckduckgo.app.browser.webview
1818

1919
import android.content.Context
2020
import android.text.SpannableStringBuilder
21+
import android.text.TextPaint
2122
import android.text.method.LinkMovementMethod
2223
import android.text.style.ClickableSpan
2324
import android.text.style.URLSpan
@@ -98,6 +99,11 @@ class MaliciousSiteBlockedWarningLayout @JvmOverloads constructor(
9899
override fun onClick(widget: View) {
99100
actionHandler()
100101
}
102+
103+
override fun updateDrawState(ds: TextPaint) {
104+
ds.color = currentTextColor
105+
ds.isUnderlineText = true
106+
}
101107
}
102108
val htmlContent = context.getString(errorResource).html(context)
103109
val spannableString = SpannableStringBuilder(htmlContent)

0 commit comments

Comments
 (0)