Is there a way to hide some (but not all) of the text in a TextView? I tried setting the size to 0 with AbsoluteSizeSpan, but that doesn\'t have any visual effect that I see.
I've figured out a way. Let's use SpannableString and Color.TRANSPARENT
For example: <> Original text : "Hello dude"
<> Expected text : "_____ dude"
val spannableString = SpannableString("Hello dude")
spannableString.setSpan(ForegroundColorSpan(Color.TRANSPARENT), 0, 5, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
yourTextView.text = spannableString