Created
January 28, 2020 16:24
-
-
Save Semper-Viventem/547468e97bcfe624d5686361f6db4871 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun initSpannableText() { | |
val span = RoundedBackgroundColorSpan( | |
backgroundColor = colors.random(), | |
padding = dp(5), | |
radius = dp(5) | |
) | |
with(spanText) { | |
setShadowLayer(dp(10), 0f, 0f, 0) // it's important for padding working | |
text = androidx.core.text.buildSpannedString { inSpans(span) { append(text.toString()) } } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment