Add isUnderlineText attribute

This commit is contained in:
Kirill Nayduik 2021-06-25 09:53:01 +03:00
parent 1a8b57de88
commit a39ec54e52
2 changed files with 4 additions and 1 deletions

View File

@ -26,11 +26,13 @@ class ActionTextView @JvmOverloads constructor(
context.withStyledAttributes(attrs, R.styleable.ActionTextView, defStyleAttr, 0) {
val actionText = getString(R.styleable.ActionTextView_actionText).orEmpty()
val actionColor = getColor(R.styleable.ActionTextView_actionColor, currentTextColor)
val isUnderlineText = getBoolean(R.styleable.ActionTextView_isUnderlineText, false)
text = text.toClickableSubstringText(
substring = actionText,
clickAction = { onClickAction.invoke() },
color = actionColor
color = actionColor,
isUnderlineText = isUnderlineText
)
}
}

View File

@ -53,6 +53,7 @@
<declare-styleable name="ActionTextView">
<attr name="actionText" format="string"/>
<attr name="actionColor" format="color"/>
<attr name="isUnderlineText" format="boolean"/>
</declare-styleable>
</resources>