14

I currently own Galaxy Note 4 with RTL in my language, and whenever I run my app it works from right to left while the app is English.

I need to some kind of "force" the app to be LTR in all kind of devices, RTL and LTR.

How I can force it?

TheUnreal
  • 23,434
  • 46
  • 157
  • 277
  • 3
    I think you can use `android:supportsRtl="false"` in your application `manifest` file. Look at [this](http://stackoverflow.com/questions/34179179/what-is-use-of-androidsupportsrtl-true-in-androidmanifest-xml-file) and [this](http://stackoverflow.com/questions/34179179/what-is-use-of-androidsupportsrtl-true-in-androidmanifest-xml-file). – Masked Man Oct 02 '16 at 13:56
  • I get application error when I put this. Unable to debug. A package i'm using is supporting RTL so it seem like a problem – TheUnreal Oct 02 '16 at 14:07

3 Answers3

34

Add in styles.xml in your Base App theme style:

<item name="android:layoutDirection">ltr</item>

Exemple:

  <!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorPrimary</item>
    <item name="android:screenOrientation">portrait</item>
    <item name="android:layoutDirection">ltr</item>
</style>
Shlomi Fresko
  • 909
  • 11
  • 15
3

Use the following attribute on your application manifest

android:supportsRtl="false"
tools:replace="android:supportsRtl"
Pier Betos
  • 1,038
  • 9
  • 17
-1

you can set android:layoutDirection="ltr" in all xml view