From f2f7d77847db405426060e81c523657a47d25352 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Sun, 3 Jun 2018 11:50:12 +0800 Subject: [PATCH] Fix language settings UI --- .../java/com/topjohnwu/magisk/SettingsActivity.java | 11 +---------- src/full/res/xml/app_settings.xml | 4 ++++ 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/full/java/com/topjohnwu/magisk/SettingsActivity.java b/src/full/java/com/topjohnwu/magisk/SettingsActivity.java index f328380f2..fef383b83 100644 --- a/src/full/java/com/topjohnwu/magisk/SettingsActivity.java +++ b/src/full/java/com/topjohnwu/magisk/SettingsActivity.java @@ -201,13 +201,9 @@ public class SettingsActivity extends Activity implements Topic.Subscriber { } private void setLocalePreference(ListPreference lp) { - boolean isNew = lp == null; - if (isNew) { - lp = new ListPreference(getActivity()); - } CharSequence[] entries = new CharSequence[mm.locales.size() + 1]; CharSequence[] entryValues = new CharSequence[mm.locales.size() + 1]; - entries[0] = getString(R.string.system_default); + entries[0] = Utils.getLocaleString(MagiskManager.defaultLocale, R.string.system_default); entryValues[0] = ""; int i = 1; for (Locale locale : mm.locales) { @@ -216,12 +212,7 @@ public class SettingsActivity extends Activity implements Topic.Subscriber { } lp.setEntries(entries); lp.setEntryValues(entryValues); - lp.setTitle(R.string.language); - lp.setKey(Const.Key.LOCALE); lp.setSummary(MagiskManager.locale.getDisplayName(MagiskManager.locale)); - if (isNew) { - generalCatagory.addPreference(lp); - } } @Override diff --git a/src/full/res/xml/app_settings.xml b/src/full/res/xml/app_settings.xml index 663c6aec8..4a969d99c 100644 --- a/src/full/res/xml/app_settings.xml +++ b/src/full/res/xml/app_settings.xml @@ -10,6 +10,10 @@ android:title="@string/settings_dark_theme_title" android:summary="@string/settings_dark_theme_summary" /> + +