Issue
I created an app that suppport three languages arabic english and french and i program a page that appear in the first time use to select the app language french and english go left to right but arabic goes right to left, I know how to change the language of the app and i know how to make the "whole" app go right to left what i dont know is how to do both things at the same time when the arabic is selected and in the same time keep the english and french go LtR if selected //second case// and another thing how to make the main language is arabic I mean that the app appear at first time with arabic RtL and then you can change it if you want from settings. please help me
Solution
You can read the developer documentation as this is a very broad question.
Most important step is to mention this in your application
tag in the Android Manifest. android:supportsRtl="true"
. This works with Android 17 and above. For older versions, you need to programatically handle this.
Please check this link for the RTL Logic and changes you need to do for the app to function in the RTL mode.
https://developer.android.com/training/basics/supporting-devices/languages#MirroringAppLogic
On Android 4.4 (API level 19) and higher, you can use android:autoMirrored="true" when defining your drawable, which allows the system to handle RTL layout mirroring for you.
You can also set the layout direction like this:
val config: Configuration = context.resources.configuration
view.layoutDirection = config.layoutDirection
Answered By - Mohit Ajwani
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.