Tag Label Text Android
Make a tag of text for android with custom background of tag.
Setup
Coppy 2 class RoundBackgroundColorSpan.java and TagLabelText.java into your widget . Don't forget add attr off TagLabelText.java in your attr file
Usage
Use as normal TextView in android
With binding. You can make some method binding in class TagLabelText like exammple. Remember remove tag android or app before attr binding to use binding. I don't know how that work :))
<com.nextsolutions.taglabeltext.TagLabelText
...
text="@{`Combo 2 Túi Nước Giặt Arie Matic Matic Đậm Đặc (2.4Kg/ Túi)`}"
tagText="@{boolean logic ? `mStore mall` : ``}"
app:tagTextBackgroundColor="#E40C0C"
app:tagTextColor="#FFF" />
In programmatically
Properties TagLabelText
boolean: tagFirst
- Textview begin with tag if set true. Textview end with tag if falseboolean: tagBold
- Make style of tag text bold if set true. This property not working if textStyle of text is bold.string: tagText
- Text of Tagdimension: tagRadius
- Roud back ground tagdimension: tagSize
- Size of tag text. Should equal or lower than text viewdimension: tagPaddingStart
- Padding Start of tagdimension: tagPaddingEnd
- Padding End of tagdimension: tagMarginStart
- MarginStart of tagdimension: tagMarginEnd
- MarginStart of tagcolor: tagTextColor
- Color of tag textcolor: tagTextBackgroundColor
- Color backgroud of tag text
Restrictions
- Size of tag should equal or lower than size of text.