I am working on localization in android.Can anyone suggest what is the best way to deal with RTL screens for Arabic language. i want design to set alignment if the user is selecting Arabic in languages
Asked
Active
Viewed 87 times
-1
-
what research have you done already? I'm sure someone else on earth must have had the same question. – Zun Apr 30 '18 at 07:26
-
There are plenty of articles you can find on google. https://android.jlelse.eu/rtl-support-on-android-here-is-all-you-need-know-e13f2df512e2 – Raj Suvariya Apr 30 '18 at 07:27
-
Possible duplicate of https://stackoverflow.com/questions/18996183/identifying-rtl-language-in-android – Nikhil Lotke Apr 30 '18 at 07:27
2 Answers
1
OK to support RTL and be Like LTR without error in design
1- when You Use Margin and Padding and Gravity Use Start Or End .. not Using Right Or Left
android:layout_marginEnd="5dp"
Not
android:layout_marginLeft="5dp"
2- store All String In String.Xml
android:hint="@string/weight"
Not
android:hint="weight"
3- it`s Prefer to use minSdkVersion to be 17
4 - if you have Image What Direction Change "Like Back Button " Use Vector Image With Monitor RTL

Elsunhoty
- 1,609
- 14
- 27
-
ok i got u....can we make different layout for RTL then we use call that layout instead – Syed Danish Haider Apr 30 '18 at 08:09
-
1Yes you can ,, But Do it Only your design Will Completely different and I don`t Advice you with this – Elsunhoty Apr 30 '18 at 08:23
0
Try this
<application
android:supportsRtl="true">
// YOUR ACTIVITY
</application>

Siddharth Patel
- 205
- 1
- 13