Open mojojojo42 opened 1 month ago
Hello, I've resolved the above-mentioned issue by adding a small piece of code in TextLeadingMarginSpan.kt
.
Inside the drawLeadingMargin(...)
, I'm calculating the x-axis
,i.e., trueX
, value for RTL Locale
s.
val trueX: Int =
if (dir > 0) {
/* For Locale direction: LTR, i.e., English, German, etc. */
marginWidth * indentation
} else {
/* For Locale direction: RTL, i.e., Arabic, Persian, etc. */
c.width - if (marginWidth * indentation == 0) {
p.measureText(string).toInt()
} else {
marginWidth * indentation
}
}
Hi @daphliu-zz @NotWoods,
Your custom
Html.TagHandler
, i.e.,ListTagHandler
, is a great help and works fine with the Left-to-RightLocale
s in Android. But it's not working as expected with the Right-to-LeftLocale
s, e.g., Persian or Arabic.Please check the screenshot below:
I tried a few changes in the
ListTagHandler
but that didn't work. I appreciate any help you can provide.