Created
May 21, 2015 08:45
-
-
Save damianpetla/aab294e68796e908b68a to your computer and use it in GitHub Desktop.
Coloring text with HTML tags
This file contains hidden or 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
val color = getResources().getString(R.color.some_color).replace("#ff", "#") | |
val terms = getString(R.string.register_terms, color) | |
termsText.setText(Html.fromHtml(terms)) |
This file contains hidden or 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
<string name="register_terms">Jag har läst och godkänt <font color=\'%1$s\'>användarvillkoren.</font></string> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment