Utilize parseAsHtml KTX extension

This commit is contained in:
TacoTheDank 2022-04-07 16:50:43 -04:00
parent 4d873e59f0
commit 6200a7f291
11 changed files with 36 additions and 80 deletions

View file

@ -23,7 +23,7 @@ import android.os.Build
import android.os.Bundle
import android.provider.Settings
import androidx.annotation.RequiresApi
import androidx.core.text.HtmlCompat
import androidx.core.text.parseAsHtml
import androidx.core.view.isVisible
import code.name.monkey.appthemehelper.ThemeStore
import code.name.monkey.appthemehelper.util.VersionUtils
@ -77,10 +77,8 @@ class PermissionActivity : AbsMusicServiceActivity() {
private fun setupTitle() {
val color = ThemeStore.accentColor(this)
val hexColor = String.format("#%06X", 0xFFFFFF and color)
val appName = HtmlCompat.fromHtml(
"Hello there! <br>Welcome to <b>Retro <span style='color:$hexColor';>Music</span></b>",
HtmlCompat.FROM_HTML_MODE_COMPACT
)
val appName = "Hello there! <br>Welcome to <b>Retro <span style='color:$hexColor';>Music</span></b>"
.parseAsHtml()
binding.appNameText.text = appName
}