I am trying things out by creating a small notepad project. And now i am having a hard time finding a solution to remove the underline on text. I can set it but i cant remove it.
Heres my code:
Heres how i set it
I use span to get the selected text
selectedString.setSpan(UnderlineSpan(), start, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
Heres how i am trying to unset it
selectedString.setSpan(UnderlineSpan().updateDrawState(TextPaint().apply { isUnderlineText = false }), start, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
I tried to search for a solution but no luck can someone help me? thanks in advance!