Skip to content

Instantly share code, notes, and snippets.

@NezSpencer
Created August 10, 2019 10:01
Show Gist options
  • Select an option

  • Save NezSpencer/bde7f3219537b5e05424218256ead81b to your computer and use it in GitHub Desktop.

Select an option

Save NezSpencer/bde7f3219537b5e05424218256ead81b to your computer and use it in GitHub Desktop.
Creaste a spannbleString copy and add needed spans
val termsCopy = SpannableString(termsText)
for (annotation in annotations) {
if (annotation.key == "action") {
termsCopy.setSpan(
createClickSpan(annotation.value),
termsText.getSpanStart(annotation),
termsText.getSpanEnd(annotation),
SpannableString.SPAN_EXCLUSIVE_EXCLUSIVE
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment