Linkify annuls my TextView text alignment

57 views Asked by At

I am using this piece of code to make my textView justified.

if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
   textView.justificationMode = LineBreaker.JUSTIFICATION_MODE_INTER_WORD
} else {
   textView.gravity = Gravity.FILL_HORIZONTAL
}

But when I use textView.autoLinkMask = Linkify.WEB_URLS the text alignment of my textView gets annulled. Respectively the text alignment is annulled only if there is some clickable URL. If the textView doesn't contain any URL, the text alignment remains justified.

I tried some libraries (e.g., BetterLinkMovementMethod), but also without success.

Any help? Or is this a standard behavior, and the text alignment of linkified text can't be changed?

0

There are 0 answers