Is there a way to get the language direction (RTL / LTR)?

I want to align the contents of the TextView according to the language (use gravity = right for Hebrew, Arabic, etc.). I tried to find a resource folder suffix such as layout-ltr or some API to help me set gravity programmatically, but I could not find. Is there a general way to do this?

+4
source share
1 answer

The identifier of the resource you should use is ldrtl, but before that, you must indicate that your application supports the RTL language by adding android: supports RTl = "true" for your manifest. Android even offers the full API for RTL. You can find information about this at http://android-developers.blogspot.fr/2013/03/native-rtl-support-in-android-42.html

0
source

Source: https://habr.com/ru/post/1437005/


All Articles