Last active
July 24, 2021 10:27
-
-
Save Turskyi/14793a83f4bb7f9b8933f878b12c18cb to your computer and use it in GitHub Desktop.
Convenient Spanned extensions for kotlin
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
fun Spanned.toHtml(): String = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { | |
Html.toHtml( this, Html.FROM_HTML_MODE_LEGACY) | |
} else { | |
@Suppress("DEPRECATION") | |
Html.toHtml(this) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment