参考其他博主文章
(23条消息) Android系统Settings添加语言_zhaoyufei133的博客-CSDN博客_android系统添加语言修改以下内容
diff --git a/build/target/product/full_base.mk b/build/target/product/full_base.mk
index 56ab476..4f89862 100755
--- a/build/target/product/full_base.mk
+++ b/build/target/product/full_base.mk
@@ -43,9 +43,7 @@ PRODUCT_PROPERTY_OVERRIDES := \
ro.config.notification_sound=pixiedust.ogg
# Put en_US first in the list, so make it default.
-PRODUCT_LOCALES := zh_CN \
- en_US \
- ru_RU
+PRODUCT_LOCALES := ru_RU en_US zh_CN
# Get some sounds
$(call inherit-product-if-exists, frameworks/base/data/sounds/AllAudio.mk)
diff --git a/packages/apps/Settings/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java b/packages/apps/Settings/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java
index 5028671..55bbd1d 100644
--- a/packages/apps/Settings/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java
+++ b/packages/apps/Settings/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java
@@ -354,7 +354,7 @@ public class InputMethodAndLanguageSettings extends SettingsPreferenceFragment
final Locale displayLocale = Locale.getDefault();
return LocaleHelper.toSentenceCase(
LocaleHelper.getDisplayLocaleList(
- locales, displayLocale, 3 /* Show up to two locales from the list */),
+ locales, displayLocale, 6 /* Show up to two locales from the list */),
displayLocale);
}
diff --git a/packages/apps/Settings/src/com/android/settings/localepicker/LocaleListEditor.java b/packages/apps/Settings/src/com/android/settings/localepicker/LocaleListEditor.java
index 281afa0..e33ea94 100644
--- a/packages/apps/Settings/src/com/android/settings/localepicker/LocaleListEditor.java
+++ b/packages/apps/Settings/src/com/android/settings/localepicker/LocaleListEditor.java
@@ -66,7 +66,6 @@ public class LocaleListEditor extends SettingsPreferenceFragment
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setHasOptionsMenu(true);
-
LocaleStore.fillCache(this.getContext());
final List<LocaleStore.LocaleInfo> feedsList = getUserLocaleList(this.getContext());
mAdapter = new LocaleDragAndDropAdapter(this.getContext(), feedsList);
@@ -221,7 +220,14 @@ public class LocaleListEditor extends SettingsPreferenceFragment
private static List<LocaleStore.LocaleInfo> getUserLocaleList(Context context) {
final List<LocaleStore.LocaleInfo> result = new ArrayList<>();
-
+ //yijf add begin
+ final Locale locale1 = new Locale("ru","RU");
+ final Locale locale2 = new Locale("en","US");
+ final Locale locale3 = new Locale("zh","CN");
+ final Locale[] newList = {locale1,locale2,locale3};
+ final LocaleList ll = new LocaleList(newList);
+ LocalePicker.updateLocales(ll);
+ //Log.d(TAG, "--yijf onTouchEvent called.--");