akexorcist / Localization

[Android] In-app language changing library
Apache License 2.0
983 stars 154 forks source link

layout direction not changes in Xiaomi phone #43

Closed sgmm0hammad closed 4 years ago

sgmm0hammad commented 4 years ago

Hello, thanks for your good library. When I use a RTL language in "Xiaomi Redmi Note 4X" phone, it changes strings correctly, but layout direction not changed.

shenawynkov commented 4 years ago

try this already answer issue #27 @Override public void setContentView(@LayoutRes int layoutResID) { super.setContentView(layoutResID); View v = findViewById(android.R.id.content); if(v!=null) { Locale locale = LanguageSetting.getLanguage(this); v.setLayoutDirection(TextUtils.getLayoutDirectionFromLocale(locale)); } }

sgmm0hammad commented 4 years ago

try this already answer issue #27 @override public void setContentView(@LayoutRes int layoutResID) { super.setContentView(layoutResID); View v = findViewById(android.R.id.content); if(v!=null) { Locale locale = LanguageSetting.getLanguage(this); v.setLayoutDirection(TextUtils.getLayoutDirectionFromLocale(locale)); } }

I changed the layoutDirection in my baseAcrivity programmatically, and fixed. however very Thank you.