Implement DateTimeSetings for Setup Wizard XL.

Make the orientation "behind", as XL would require landscape.

TODO:
- Automatic Time Zone should be available.
- Layout is immature: need to have better theme and layout xml.

Change-Id: Iafe141223a227643ca774f4df5e5b7fde9520d31
This commit is contained in:
Daisuke Miyakawa
2010-09-09 11:51:16 -07:00
parent 0f4f2f3a81
commit 71cc548f7e
7 changed files with 330 additions and 86 deletions

View File

@@ -52,7 +52,7 @@ public class ZonePicker extends ListFragment {
public static interface ZoneSelectionListener {
// You can add any argument if you really need it...
public void onZoneSelected();
public void onZoneSelected(TimeZone tz);
}
private static final String KEY_ID = "id";
@@ -235,9 +235,13 @@ public class ZonePicker extends ListFragment {
// Update the system timezone value
final Activity activity = getActivity();
AlarmManager alarm = (AlarmManager) activity.getSystemService(Context.ALARM_SERVICE);
alarm.setTimeZone((String) map.get(KEY_ID));
String tzId = (String) map.get(KEY_ID);
alarm.setTimeZone(tzId);
final TimeZone tz = TimeZone.getTimeZone(tzId);
if (mListener != null) {
mListener.onZoneSelected();
mListener.onZoneSelected(tz);
} else {
getActivity().onBackPressed();
}
}