Hello everyone. How can I replicate the behavior ...
# compose
n
Hello everyone. How can I replicate the behavior of the Gmail app’s email input field for Arabic locales using Compose’s TextField? I’ve experimented with various combinations of TextDirection, but I can’t achieve the desired effect. The cursor doesn’t always appear where I expect it to be, and symbols like @ or ! are displayed on the left side of English text when they are the last characters.
z
Might be a bug
n
To anyone who might be interested - I’ve managed to reproduce Gmail behaviour using
TextStyle's
textAlign
in combination with
textDirection
Copy code
textDirection = TextDirection.ContentOrLtr, textAlign = TextAlign.Right
This is what I plan to use when LayoutDirection is RTL for all email, password, phone and similar input fields with predominately english text. Arabic localisation is already confusing, there is definitely a room for improvement from the framework side
z
If you want the framework to improve, please file this as a bug
s
I think this is expected behavior, not sure what else could Compose do here. Respecting the layout direction is the correct thing to do in most cases, and you opt-out when you don't want to.