33import android .annotation .TargetApi ;
44import android .content .Context ;
55import android .content .Intent ;
6+ import android .graphics .Bitmap ;
67import android .net .Uri ;
78import android .os .Build ;
89import android .os .Bundle ;
@@ -54,7 +55,7 @@ protected void onCreate(Bundle savedInstanceState) {
5455 getApplication ().getResources ().getString (R .string .current_language ));
5556 mSystemLanguageView = findViewById (R .id .tv_main_language_system );
5657 mSystemLanguageView .setText (MultiLanguages .getLanguageString (this ,
57- MultiLanguages .getSystemLanguage (this ), R .string .current_language ));
58+ MultiLanguages .getSystemLanguage (this ), R .string .current_language ));
5859
5960 if (MultiLanguages .isSystemLanguage (this )) {
6061 radioGroup .check (R .id .rb_main_language_auto );
@@ -66,6 +67,8 @@ protected void onCreate(Bundle savedInstanceState) {
6667 radioGroup .check (R .id .rb_main_language_tw );
6768 } else if (LocaleContract .getEnglishLocale ().equals (locale )) {
6869 radioGroup .check (R .id .rb_main_language_en );
70+ } else if (LocaleContract .getArabicLocale ().equals (locale )) {
71+ radioGroup .check (R .id .rb_main_language_ar );
6972 } else {
7073 radioGroup .check (R .id .rb_main_language_auto );
7174 }
@@ -94,6 +97,9 @@ public void onCheckedChanged(RadioGroup group, int checkedId) {
9497 } else if (checkedId == R .id .rb_main_language_en ) {
9598 // 英语
9699 restart = MultiLanguages .setAppLanguage (this , LocaleContract .getEnglishLocale ());
100+ } else if (checkedId == R .id .rb_main_language_ar ) {
101+ // 阿拉伯语
102+ restart = MultiLanguages .setAppLanguage (this , LocaleContract .getArabicLocale ());
97103 }
98104
99105 if (restart ) {
@@ -130,7 +136,7 @@ public void onResume() {
130136 return ;
131137 }
132138 mSystemLanguageView .setText (MultiLanguages .getLanguageString (this ,
133- MultiLanguages .getSystemLanguage (this ), R .string .current_language ));
139+ MultiLanguages .getSystemLanguage (this ), R .string .current_language ));
134140 }
135141
136142 @ Override
@@ -189,6 +195,15 @@ public boolean shouldOverrideUrlLoading(WebView view, String url) {
189195 }
190196 return true ;
191197 }
198+ @ Override
199+ public void onPageStarted (WebView view , String url , Bitmap favicon ) {
200+ super .onPageStarted (view , url , favicon );
201+
202+ if (LocaleContract .shouldRTL (MultiLanguages .getAppLanguage (view .getContext ()))) {
203+ // 水平滚动条滚动到最右边
204+ view .scrollTo (view .getWidth (), 0 );
205+ }
206+ }
192207 }
193208
194209 /**
0 commit comments