Hi guys, I have a problem regarding RTL. I've goog...
# compose
k
Hi guys, I have a problem regarding RTL. I've googled, but I couln't find the similar issues. While dealing with Arabic, if I call
Text("تزامن...")
in
AmbientLayoutDirection
as
Ltr
, there will be an extra wrap line (see picture below). But it stays normal while as
Rtl
. Anyone have any solutions or suggestions? Thanks in advance!
Copy code
Providers(AmbientLayoutDirection provides LayoutDirection.Ltr) {  
 Text("LTR")  
 Text("تزامن...")  
 Text("مزيد من المعلومات.")  
}  
Providers(AmbientLayoutDirection provides LayoutDirection.Rtl) {  
 Text("RTL")  
 Text("تزامن...")  
 Text("مزيد من المعلومات.")  
}
j
have you tried using
Copy code
modifier = Modifier.fillMaxWidth()
for the text?
k
Yes, it works. Yet, under some circumstances, I need to use
wrapContent
.
s
For your info, where to align the RTL language by default required a lot of discussions, and I am still not sure what the default behavior should be. WE still have the
TextDirection.Content
,
TextDirection.ContentOrLtr
configuration options where you can ask the system to align the text to RTL when the text is RTL.
android dance 1
That will change the behavior of Text to align RTL text to right even if layout direction is LTR (as far as I remember, not sure if it would require the code that Julius mentioned)
k
@Siyamed Thank you for providing this option, that totally solve the issue once and for all!