Closed Robin-AF closed 2 years ago
Yeah, the *
is appended to the item title; but usually FormItemTextAreaFloatingHint
doesn't have a title. If you want to show the *
in its hint, you cay try something like
+FormItemTextAreaFloatingHint().hint("Multi-line text with floating hint here ...")
.tag("notes").onSetup { item, viewHolder ->
val styledString = SpannableString(item.hint + "*")
styledString.setSpan(
ForegroundColorSpan(Color.RED),
styledString.length - 1,
styledString.length,
0
)
(viewHolder as? FormBaseTextViewHolder)?.let {
it.hintView?.hint = styledString
}
}
Thanks @tianzhuqiao thats a wondeful solution, I wonder if it might be nice to add to FormItemTextAreaFloatingHint
by default seeing as this specific use case not have the title. What are your thoughts?
For now at least it's solved with this temporary solution.
Hi,
As far as I can tell when you have
FormItemTextAreaFloatingHint
and set.required(true)
it does not show the * on the item like it does on the other items.