Reputation: 4472
I am working on an application that will work on Android WebView
. I enabled the selection and copy for this view. In some devices that support Arabic, When I paste the copied text from WebView
in any EditText
view, It shows me the reserve text. but In some cases it shows me the correct form.
Could any one please help me to show in correct form in all devices ? :-/
I have red all threads that depend on supporting Arabic and Farsi Text, but I can not reach my purpose.
Thanks in advance :)
Upvotes: 1
Views: 676
Reputation: 1451
Android has Added support for RTL in Native widgets(i.e TextView , EditText) . so if u run the app onward 4.2 u will get RTL feature automatically ,
http://android-developers.blogspot.com.es/2013/03/native-rtl-support-in-android-42.html
You can create different versions of the layouts for different API versions.
As you can read here: http://developer.android.com/guide/topics/resources/providing-resources.html you can have say the normal folder (/res/layout/) with the layout for old devices and then another one for the ones that support it: /res/layout-11/
The layout inside layout-v11 will only be applied on devices with android 3.0 and over.
Upvotes: 0
Reputation: 13436
You can pass your copied text to FarsiLibrary. It will analyses your text letters and justify them according to their possible 4 states (Initial, Middle, End, Isolated) :
Initial like 'ن' in 'نازک' Middle like 'ن' in 'هنر' End like 'ن' in 'وطن' Isolated like 'ن' in 'ایران'
Upvotes: 1