Marco Fedele
Marco Fedele

Reputation: 2148

Android Arabic Cursor Split

I'm using a custom EditText because client wants to force arabic locale globally in the app.

Here is the code I use in the constructor of the EditText:

setTextDirection(TEXT_DIRECTION_LOCALE);

It works perfectly, but I have a strange behavior of the cursor as you can see in the image

enter image description here

Somebody knows if it's normal or how can I solve this?

Thank you

Upvotes: 2

Views: 1583

Answers (2)

Bilal Ahmed
Bilal Ahmed

Reputation: 358

This is the normal behaviour. But if you still want to forcefully acheive this, than this worked for me:

ViewCompat.setLayoutDirection(edtEmail, ViewCompat.LAYOUT_DIRECTION_LTR);

along with the gravity field

Upvotes: 0

Marco Fedele
Marco Fedele

Reputation: 2148

Found the solution there: https://ux.stackexchange.com/a/39639 Apparently, it's the normal behavior when you have rtl and ltr text mixed.

Upvotes: 2

Related Questions