SHARE
TWEET

Untitled

a guest Jul 22nd, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. private fun span(s: CharSequence, o: Any) = (if (s is String) SpannableString(s) else s as? SpannableString
  2.         ?: SpannableString("")).apply { setSpan(o, 0, length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE) }
  3.  
  4. operator fun SpannableString.plus(s: SpannableString) = SpannableString(TextUtils.concat(this, s))
  5.  
  6. fun color(color: Int, s: CharSequence) = span(s, ForegroundColorSpan(color))
  7.  
  8. "Top trending position: " + color(Color.RED, poll.topTrendingPosition.toString())
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top