mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-24 02:15:46 +03:00
respecting the underline parameter by only applying an underline when it's set
- updates the default value to true and that was the existing intentional behaviour
This commit is contained in:
parent
b6ff6aa4cc
commit
00bbede802
1 changed files with 1 additions and 2 deletions
|
@ -82,7 +82,7 @@ fun TextView.setTextWithColoredPart(@StringRes fullTextRes: Int,
|
||||||
fun TextView.setTextWithColoredPart(fullText: String,
|
fun TextView.setTextWithColoredPart(fullText: String,
|
||||||
coloredPart: String,
|
coloredPart: String,
|
||||||
@AttrRes colorAttribute: Int = R.attr.colorPrimary,
|
@AttrRes colorAttribute: Int = R.attr.colorPrimary,
|
||||||
underline: Boolean = false,
|
underline: Boolean = true,
|
||||||
onClick: (() -> Unit)? = null) {
|
onClick: (() -> Unit)? = null) {
|
||||||
val color = ThemeUtils.getColor(context, colorAttribute)
|
val color = ThemeUtils.getColor(context, colorAttribute)
|
||||||
|
|
||||||
|
@ -101,7 +101,6 @@ fun TextView.setTextWithColoredPart(fullText: String,
|
||||||
|
|
||||||
override fun updateDrawState(ds: TextPaint) {
|
override fun updateDrawState(ds: TextPaint) {
|
||||||
ds.color = color
|
ds.color = color
|
||||||
ds.isUnderlineText = !underline
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
setSpan(clickableSpan, index, index + coloredPart.length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
|
setSpan(clickableSpan, index, index + coloredPart.length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
|
||||||
|
|
Loading…
Reference in a new issue