Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private fun span(s: CharSequence, o: Any) = (if (s is String) SpannableString(s) else s as? SpannableString
- ?: SpannableString("")).apply { setSpan(o, 0, length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE) }
- operator fun SpannableString.plus(s: SpannableString) = SpannableString(TextUtils.concat(this, s))
- fun color(color: Int, s: CharSequence) = span(s, ForegroundColorSpan(color))
- "Top trending position: " + color(Color.RED, poll.topTrendingPosition.toString())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement