val textView = findViewById<TextView>(R.id.text)
textView.text = buildSpannableString {
span("Hello") {
color(Color.RED)
size(14)
}
append(" ")
span("World") {
color(Color.BLUE)
size(18)
bold()
}
}
Step 1. Add the JitPack repository to your build file
Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.senseless00:Spannable:Tag'
}