Reputation: 918
I want to make my Toolbar
always arrange it's children Right-To-Left rtl
like that
Upvotes: 0
Views: 627
Reputation: 918
I found solution for that problem.
First and thanks to @Eugene
<application
...
android:supportsRtl="true">
</application>
Second Force every Activity
to use specific Locale
private void updateResources(String language) {
Locale locale = new Locale(language);
Locale.setDefault(locale);
Resources resources = getResources();
Configuration configuration = resources.getConfiguration();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
configuration.setLocale(locale);
} else {
//noinspection deprecation
configuration.locale = locale;
}
resources.updateConfiguration(configuration, resources.getDisplayMetrics());
}
Upvotes: 0
Reputation: 3568
Add this to your manifest.
<application
...
android:supportsRtl="true">
</application>
Upvotes: 1