I am working on an animation that involves setting OutlineSpan to individual letter in a word . However when i apply the OutlineSpan to first letter its not reflecting
val string = "f"
val spannableString = SpannableString(string)
val outlineSpan = OutlineSpan(255, ContextCompat.getColor(this, R.color.white), 1f.dp)
//val outlineSpan = ForegroundColorSpan( ContextCompat.getColor(this, R.color.white))
spannableString.setSpan(outlineSpan, 0, 1, 0)
textViewHollow.setText(spannableString)
When i try applying another span it's working but not the outline span . Code to outline span https://gist.github.com/santaevpavel/61eb23092bdb8a926aeb8302ec95b4b6
I went through the actual lib of Outlined Text. Here: https://github.com/santaevpavel/OutlineSpan
I found a new updated version of
OutlineSpan. You can replace your version with the following.Then use it like:
This resolves the issue.
Output: