I need to create a custom text-view in android, first of all it should be justified, then it should support spans and although it should support RTL (Right to Left) languages for ex: Farsi (Persian) ,...
I'm working on this issue for a week! but In fact I stuck In a bad condition because non of available libraries support all these conditions ( Justify, Spanable, RTL)
Do you have any idea?!
I although checked lots of libraries for ex: Link
This code worked for my rtl textView :
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
textView.setJustificationMode(LineBreaker.JUSTIFICATION_MODE_INTER_WORD);
}else {
textView.setTextAlignment(View.TEXT_ALIGNMENT_CENTER);
textView.setGravity(Gravity.CENTER_HORIZONTAL);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With