1

I have an EditText in my app. I tried to use JUSTIFICATION_MODE_INTER_WORD (https://developer.android.com/reference/android/text/Layout#JUSTIFICATION_MODE_INTER_WORD) To make it's text justified:

editor.setJustificationMode(JUSTIFICATION_MODE_INTER_WORD);

It's not working at all, while it's working on simple TextView control:

textView1.setJustificationMode(JUSTIFICATION_MODE_INTER_WORD);

It's not documented whether EditText supports justification or not?

I have set my minimum OS to 28, still not working.

Any suggestion on how to justify my editor? No more rich edit features I need.

AVEbrahimi
  • 17,993
  • 23
  • 107
  • 210

1 Answers1

1

Even on a TextView, it works only if the text does not have to be a Spannable. For example, if you set textIsSelectable to true on a TextView, the text won't be justified and is will be an instance of Spanned instead of Spannable.

Which means, I think, if the text layout can be modified in any way, by directly editing the characters in an EditText or by setting text size spans or image spans in a TextView, then it cannot be justified.