最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How i can make the whole android app text from the left to right? - Stack Overflow

programmeradmin4浏览0评论

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
Add a comment  | 

1 Answer 1

Reset to default 0

You 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
发布评论

评论列表(0)

  1. 暂无评论