i am creating an android app, my phone language in Arabic and i do not want to change that, but i am building the app for left to right users, is there a setting i can put that when i debug on my personal phone to recognizes to debug from left to right opposite to my phone language?
i am thinking about using an simulator but i do not want to deal with the slowness of the android studio
i am creating an android app, my phone language in Arabic and i do not want to change that, but i am building the app for left to right users, is there a setting i can put that when i debug on my personal phone to recognizes to debug from left to right opposite to my phone language?
i am thinking about using an simulator but i do not want to deal with the slowness of the android studio
Share Improve this question asked Mar 23 at 18:24 طارق خليلطارق خليل 31 bronze badge 1- I had the specular need, i.e. setting right to left, but I'm using English language. In my case I activated developer options (just google to see how) and I had the possibility to force RTL mode. I don't know if the reverse apply, i.e. if using Arabic as default, the developer options would provide LTR mode. – Livio Commented Mar 23 at 19:20
1 Answer
Reset to default 0You can always design it in LTR and it won't change. If it changes you could do this to force LTR your application.
=> You can add this to your manifest
android:supportsRtl="false"
=> You can even add it to your application theme in the res/styles
.
<!-- 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>
<!-- your ltr theme -->
<item name="android:layoutDirection">ltr</item>
</style>
=> The last way is to add it programmatically in your activity.
//Java
getWindow().getDecorView().setLayoutDirection(View.LAYOUT_DIRECTION_LTR);
//Kotlin
window.decorView.layoutDirection = View.LAYOUT_DIRECTION_LTR