Fragmentize ZoneList, which is needed in DateTimeSettings refactoring.

- remove old ZonePicker and rename ZoneList to ZonePicker, as
  the name is really confusing (see LocalePicker)
- Make the new ZonePicker fragment.
- remove dependency toward "ZoneList" class.
-- AndroidManifest.xml does not allow the other components to
   access ZoneList directly, so it would be ok to remove without
   using activity-alias.
-- Noticed there is a significant code duplication between
   DateTimeSettings and DateTimeSettingsActivity. I'll work on it
   later.
- add DateTimeSettingsSetupWizardXL class, which is not used yet,
  but will be in the near future.
-- It is not recognized by AndroidManifest.xml

Change-Id: Id26152a3d560f9e0bd84afdf3e1c5101f0e166b4
This commit is contained in:
Daisuke Miyakawa
2010-09-03 15:40:17 -07:00
parent 0cec40628b
commit 0f4f2f3a81
8 changed files with 262 additions and 325 deletions

View File

@@ -41,8 +41,7 @@ import java.util.Calendar;
import java.util.Date;
import java.util.TimeZone;
public class DateTimeSettings
extends SettingsPreferenceFragment
public class DateTimeSettings extends SettingsPreferenceFragment
implements OnSharedPreferenceChangeListener,
TimePickerDialog.OnTimeSetListener , DatePickerDialog.OnDateSetListener {
@@ -152,6 +151,7 @@ public class DateTimeSettings
mDateFormat.setSummary(shortDateFormat.format(dummyDate));
}
@Override
public void onDateSet(DatePicker view, int year, int month, int day) {
Calendar c = Calendar.getInstance();
@@ -166,6 +166,7 @@ public class DateTimeSettings
updateTimeAndDateDisplay();
}
@Override
public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
Calendar c = Calendar.getInstance();
@@ -183,6 +184,7 @@ public class DateTimeSettings
// SystemClock time.
}
@Override
public void onSharedPreferenceChanged(SharedPreferences preferences, String key) {
if (key.equals(KEY_DATE_FORMAT)) {
String format = preferences.getString(key,
@@ -274,12 +276,8 @@ public class DateTimeSettings
set24Hour(((CheckBoxPreference)mTime24Pref).isChecked());
updateTimeAndDateDisplay();
timeUpdated();
} else if (preference == mTimeZone) {
Intent intent = new Intent();
intent.setClass(getActivity(), ZoneList.class);
startActivityForResult(intent, 0);
}
return false;
return super.onPreferenceTreeClick(preferenceScreen, preference);
}
@Override