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?
right to left - Android Studio Support rtl - Stack Overflow.
Just go to Android Studio > Refactor > Add RTL support where possible… I would recommend you checking your app once after applying this change as you might not want all your Layouts/Views to be RTL. If you want to force any layout to LTR then just add android:layoutDirection="ltr" to that view.
RTL text mirroring is only supported in apps when used on devices running Android 4.2 (API level 17) or higher.
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With