How to enable RTL/Arab support?


Open the Manifest.xml file and add the following attribute to the 'application' tag. 

android:supportsRtl="true"

This should make your Application tag look something like (line 30):

<application

        android:icon="@drawable/ic_launcher"

        android:theme="@style/AppTheme"

        android:label="@string/app_name"

        android:supportsRtl="true"

        android:allowBackup="true" >

        <activity

Note that RTL will only work if you meet the following conditions:

  • You are on Android 4.2 or higher
  • You are using an RTL device language/mode (like hebrew).
    Please note that a device is only in RTL language if you find that the time is located left in the status bar and that the rest of the system UI is RTL as well.
  • Your content is also in RTL format (e.g. an RTL/Hebrew RSS feed or blog)
  • You are using V2.2.1 of the template (or higher)

It's recommended to manually translate all the strings, to make sure they fit in your layout.

To change the location of the icons in the menu:

Add this line in NavDrawerAdapter, in setText() function: 

textView.setCompoundDrawablesWithIntrinsicBounds(null, null, drawable, null);
Tags: rtl
Last update:
2016-09-15 16:12
Author:
Sherdle
Revision:
1.7
Average rating: 5 (1 Vote)

You can comment this FAQ