Skip to content
This repository has been archived by the owner on Jun 22, 2022. It is now read-only.

layout direction not changes in Xiaomi phone #43

Closed
sgmm0hammad opened this issue Jan 30, 2020 · 2 comments
Closed

layout direction not changes in Xiaomi phone #43

sgmm0hammad opened this issue Jan 30, 2020 · 2 comments

Comments

@sgmm0hammad
Copy link

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
Copy link

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
Copy link
Author

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants