106

Whenever I created new project in android studio, I got android:supportsRtl="true" in my app AndroidManifest File.

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
...
</application>

What is use in app, or what is advantages & disadvantage when I add or not add in my app AndroidManifest .

pRaNaY
  • 24,642
  • 24
  • 96
  • 146
  • 6
    I don't feel this as a duplicate question. Both are regarding RTL, but people who search for these will defer. – SREE Aug 25 '16 at 05:53
  • 2
    The question to which this is referenced as duplicate is wrong. Totally different context for user searching the question. – Jaydev Mar 02 '17 at 08:11
  • 2
    TLDR https://android.jlelse.eu/rtl-support-on-android-here-is-all-you-need-know-e13f2df512e2 – VVB Oct 28 '18 at 06:37

4 Answers4

96

Declares whether your application is willing to support right-to-left (RTL) layouts. If set to true and targetSdkVersion is set to 17 or higher, various RTL APIs will be activated and used by the system so your app can display RTL layouts. If set to false or if targetSdkVersion is set to 16 or lower, the RTL APIs will be ignored or will have no effect and your app will behave the same regardless of the layout direction associated to the user's Locale choice (your layouts will always be left-to-right).

The default value of this attribute is false.

This attribute was added in API level 17.

(Source: http://developer.android.com/guide/topics/manifest/application-element.html)

Suragch
  • 484,302
  • 314
  • 1,365
  • 1,393
Gex
  • 2,092
  • 19
  • 26
90

if you are building an app in Arabic, Urdu, Hebrew, etc... or any language that is written from right to left you should set android:supportsRtl to true, that's how you tell the layout to be from right to left, and The default value of this attribute is false.

Sarah
  • 1,195
  • 10
  • 17
  • 20
    Better than Google documentation. – CopsOnRoad Oct 26 '17 at 15:51
  • 1
    Thanks to the other responses, but this kind of response is more usefull and complete the documentation. Thank you @Sarah. – Nicoolasens May 15 '19 at 08:49
  • 1
    hi, my app isn't support arabic language but i am using android:supportsRtl="true" in manifest.xml is this problem ? – ozanurkan Jun 27 '19 at 13:08
  • 6
    @ozanurkan - Not a problem. **This answer is wrong/misleading.** `android:supportsRtl="true"` enables *support* for right-to-left languages. Without this, layout will always be left-to-right, *However* by itself **it does not** change the layout to be from right to left. It simply enables other attributes - one of those new attributes controls whether is left-to-right or right-to-left. – ToolmakerSteve Dec 01 '19 at 22:15
10

From Android API-Guides:

(developer.android.com/guide/topics/manifest/application-element.html)

Declares whether your application is willing to support right-to-left (RTL) layouts.

If set to true and targetSdkVersion is set to 17 or higher, various RTL APIs will be activated and used by the system so your app can display RTL layouts. If set to false or if targetSdkVersion is set to 16 or lower, the RTL APIs will be ignored or will have no effect and your app will behave the same regardless of the layout direction associated to the user's Locale choice (your layouts will always be left-to-right).

The default value of this attribute is false.

This attribute was added in API level 17.

Community
  • 1
  • 1
wasntme
  • 120
  • 7
0

If you develop application which supports RTL layouts(layout mirroring) you should tace care of two things

  1. Declare supporting RTL mirroring in AndroidManifest.xml
<application
    android:supportsRtl="true">
</application>
  1. Use start/end instead/in addition to left/right
android:margineLeft
android:margineStart
yoAlex5
  • 29,217
  • 8
  • 193
  • 205