summaryrefslogtreecommitdiffstats
path: root/core/java/com
diff options
context:
space:
mode:
authorDaisuke Miyakawa <dmiyakawa@google.com>2010-12-28 10:07:30 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-12-28 10:07:30 -0800
commit4105f1e9459854b57810cd1446c41d8a1c52b118 (patch)
tree05921eff85ea687a767692312bdd83355523557b /core/java/com
parent864dd1ca3a070265a0f46521ddd62ec46d8da229 (diff)
parent2b133574bbfd076ff7f8bfac27a0f1226e47abeb (diff)
downloadframeworks_base-4105f1e9459854b57810cd1446c41d8a1c52b118.zip
frameworks_base-4105f1e9459854b57810cd1446c41d8a1c52b118.tar.gz
frameworks_base-4105f1e9459854b57810cd1446c41d8a1c52b118.tar.bz2
Merge "Let callers replace layout for LocalePicker adapter."
Diffstat (limited to 'core/java/com')
-rw-r--r--core/java/com/android/internal/app/LocalePicker.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/core/java/com/android/internal/app/LocalePicker.java b/core/java/com/android/internal/app/LocalePicker.java
index 6f6b40b..e32c62d 100644
--- a/core/java/com/android/internal/app/LocalePicker.java
+++ b/core/java/com/android/internal/app/LocalePicker.java
@@ -82,6 +82,11 @@ public class LocalePicker extends ListFragment {
* {@link LocaleInfo#label}.
*/
public static ArrayAdapter<LocaleInfo> constructAdapter(Context context) {
+ return constructAdapter(context, R.layout.locale_picker_item, R.id.locale);
+ }
+
+ public static ArrayAdapter<LocaleInfo> constructAdapter(Context context,
+ int layoutId, int fieldId) {
final Resources resources = context.getResources();
final String[] locales = context.getAssets().getLocales();
final String[] specialLocaleCodes = resources.getStringArray(R.array.special_locale_codes);
@@ -149,8 +154,6 @@ public class LocalePicker extends ListFragment {
localeInfos[i] = preprocess[i];
}
Arrays.sort(localeInfos);
- final int layoutId = R.layout.locale_picker_item;
- final int fieldId = R.id.locale;
return new ArrayAdapter<LocaleInfo>(context, layoutId, fieldId, localeInfos);
}