Modifications for changes to SettingsLib
See associated changes in frameworks/base for details. Bug: 19058953 Bug: https://code.google.com/p/android-developer-preview/issues/detail?id=2132 Change-Id: Ic3393df28dd63ca75b203d1d0430d69cab7c40de
This commit is contained in:
@@ -165,7 +165,7 @@ public class DateTimeSettings extends SettingsPreferenceFragment
|
|||||||
Date dummyDate = mDummyDate.getTime();
|
Date dummyDate = mDummyDate.getTime();
|
||||||
mDatePref.setSummary(DateFormat.getLongDateFormat(context).format(now.getTime()));
|
mDatePref.setSummary(DateFormat.getLongDateFormat(context).format(now.getTime()));
|
||||||
mTimePref.setSummary(DateFormat.getTimeFormat(getActivity()).format(now.getTime()));
|
mTimePref.setSummary(DateFormat.getTimeFormat(getActivity()).format(now.getTime()));
|
||||||
mTimeZone.setSummary(ZoneGetter.getTimeZoneText(now.getTimeZone(), true));
|
mTimeZone.setSummary(ZoneGetter.getTimeZoneOffsetAndName(now.getTimeZone(), now.getTime()));
|
||||||
mTime24Pref.setSummary(DateFormat.getTimeFormat(getActivity()).format(dummyDate));
|
mTime24Pref.setSummary(DateFormat.getTimeFormat(getActivity()).format(dummyDate));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -87,8 +87,7 @@ public class ZonePicker extends ListFragment {
|
|||||||
|
|
||||||
final String sortKey = (sortedByName ? ZoneGetter.KEY_DISPLAYNAME : ZoneGetter.KEY_OFFSET);
|
final String sortKey = (sortedByName ? ZoneGetter.KEY_DISPLAYNAME : ZoneGetter.KEY_OFFSET);
|
||||||
final MyComparator comparator = new MyComparator(sortKey);
|
final MyComparator comparator = new MyComparator(sortKey);
|
||||||
final ZoneGetter zoneGetter = new ZoneGetter();
|
final List<Map<String, Object>> sortedList = ZoneGetter.getZonesList(context);
|
||||||
final List<HashMap<String, Object>> sortedList = zoneGetter.getZones(context);
|
|
||||||
Collections.sort(sortedList, comparator);
|
Collections.sort(sortedList, comparator);
|
||||||
final SimpleAdapter adapter = new SimpleAdapter(context,
|
final SimpleAdapter adapter = new SimpleAdapter(context,
|
||||||
sortedList,
|
sortedList,
|
||||||
@@ -226,7 +225,7 @@ public class ZonePicker extends ListFragment {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class MyComparator implements Comparator<HashMap<?, ?>> {
|
private static class MyComparator implements Comparator<Map<?, ?>> {
|
||||||
private String mSortingKey;
|
private String mSortingKey;
|
||||||
|
|
||||||
public MyComparator(String sortingKey) {
|
public MyComparator(String sortingKey) {
|
||||||
@@ -237,7 +236,7 @@ public class ZonePicker extends ListFragment {
|
|||||||
mSortingKey = sortingKey;
|
mSortingKey = sortingKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int compare(HashMap<?, ?> map1, HashMap<?, ?> map2) {
|
public int compare(Map<?, ?> map1, Map<?, ?> map2) {
|
||||||
Object value1 = map1.get(mSortingKey);
|
Object value1 = map1.get(mSortingKey);
|
||||||
Object value2 = map2.get(mSortingKey);
|
Object value2 = map2.get(mSortingKey);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user