I have a custom TextView that combines two pieces of text and have a spacing variable.
class MyCustomTextView() {
var label: String
var value: String
var spacingBetweenLabelAndValue: Int = 0
// ...
}
Each one have their own style and are concatenated. Example:
- label -> "Name:"
- value -> "John"
this.text = Spanny(label, *labelTextSpannables)
.append(value, *valueTextSpannables)
which in the end is resulting in "Name:John"
I want to add an extra spacing (spacingBetweenLabelAndValue
) between those two strings.
"Name:(spacing here)John"
Is there a way to do this using Spannable?