• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

packages/apps/Settings


Commit MetaInfo

Revisão0fd7736b7153c1a304d7c6098ecf1223052f56d5 (tree)
Hora2011-06-08 04:53:41
AutorFreeman Ng <tenorslowworm@goog...>
CommiterAndroid (Google) Code Review

Mensagem de Log

Merge "use prefs-style layout for setup wizard date/time settings on non-xlarge screens" into honeycomb-mr2

Mudança Sumário

Diff

--- a/res/layout-sw600dp/date_time_settings_setupwizard.xml
+++ b/res/layout-sw600dp/date_time_settings_setupwizard.xml
@@ -1,168 +1,68 @@
11 <?xml version="1.0" encoding="utf-8"?>
2-<!-- Copyright (C) 2010 The Android Open Source Project
2+<!-- Copyright (C) 2011 The Android Open Source Project
33
44 Licensed under the Apache License, Version 2.0 (the "License");
55 you may not use this file except in compliance with the License.
66 You may obtain a copy of the License at
77
8- http://www.apache.org/licenses/LICENSE-2.0
8+ http://www.apache.org/licenses/LICENSE-2.0
99
1010 Unless required by applicable law or agreed to in writing, software
1111 distributed under the License is distributed on an "AS IS" BASIS,
1212 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313 See the License for the specific language governing permissions and
1414 limitations under the License.
15- -->
16-<RelativeLayout
17- android:id="@+id/layout_root"
18- xmlns:android="http://schemas.android.com/apk/res/android"
19- android:orientation="vertical"
20- android:layout_width="match_parent"
21- android:layout_height="match_parent"
22- android:paddingTop="@dimen/datetime_margin_top"
23- android:paddingLeft="@dimen/screen_margin_sides"
24- android:paddingRight="@dimen/screen_margin_sides"
25- android:paddingBottom="@dimen/datetime_margin_bottom">
15+-->
2616
27- <!-- Title: Set date & time-->
28- <TextView
29- android:id="@+id/title"
30- android:layout_width="wrap_content"
31- android:layout_height="wrap_content"
32- android:minHeight="48dip"
33- android:layout_alignParentLeft="true"
34- android:layout_marginLeft="16dip"
35- android:layout_alignParentTop="true"
36- android:textSize="32dip"
37- android:textColor="#FF99cc00"
38- android:text="@string/date_and_time_settings_title_setup_wizard"
39- android:gravity="bottom" />
40-
41- <!-- Divider -->
42- <View
43- android:id="@+id/top_divider"
17+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
18+ android:id="@+id/layout_root"
19+ android:layout_height="match_parent"
4420 android:layout_width="match_parent"
45- android:layout_height="3dip"
46- android:layout_below="@id/title"
47- android:layout_marginTop="6dip"
48- android:layout_marginBottom="17dip"
49- android:background="@color/divider_color" />
50-
51- <RelativeLayout
52- android:id="@+id/timezone_auto_time"
53- android:layout_width="716dip"
54- android:layout_height="wrap_content"
55- android:layout_centerHorizontal="true"
56- android:layout_below="@id/top_divider">
57- <!-- timezone -->
58- <Button
59- android:id="@+id/time_zone_button"
60- style="?android:attr/dropDownSpinnerStyle"
61- android:layout_width="304dip"
62- android:layout_height="48dip"
63- android:layout_alignParentLeft="true"
64- android:layout_alignBottom="@+id/date_time_auto"
65- android:gravity="left|center_vertical"
66- android:textAppearance="?android:attr/textAppearanceMedium"
67- android:textSize="20dip" />
68-
69- <LinearLayout
70- android:id="@+id/date_time_auto"
71- android:layout_width="wrap_content"
72- android:layout_height="wrap_content"
73- android:orientation="vertical"
74- android:layout_toRightOf="@id/time_zone_button"
75- android:layout_marginLeft="32dip"
76- android:layout_alignParentRight="true">
77-
78- <Switch
79- android:id="@+id/date_time_auto_button"
80- android:layout_width="match_parent"
81- android:layout_height="wrap_content"
82- android:minHeight="?android:attr/listPreferredItemHeight"
83- android:layout_marginLeft="16dip"
84- android:text="@string/date_time_auto"
85- android:textAppearance="?android:attr/textAppearanceMedium"
86- android:textSize="20dip" />
87-
88- <!-- Divider -->
89- <View
90- android:layout_width="match_parent"
91- android:layout_height="1px"
92- android:background="@color/divider_color" />
93- </LinearLayout>
94- </RelativeLayout>
21+ android:paddingTop="96dip"
22+ android:paddingLeft="40dip"
23+ android:paddingRight="40dip"
24+ android:paddingBottom="96dip"
25+ android:orientation="vertical">
26+
27+ <FrameLayout android:id="@+id/timezone_dropdown_anchor"
28+ android:layout_height="0px"
29+ android:layout_width="match_parent"
30+ android:layout_marginLeft="40dip"
31+ android:layout_marginRight="40dip"/>
32+
33+ <LinearLayout android:layout_height="0px"
34+ android:layout_weight="1"
35+ android:layout_width="match_parent"
36+ android:orientation="vertical">
37+
38+ <fragment android:id="@+id/date_time_settings_fragment"
39+ class="com.android.settings.DateTimeSettings"
40+ android:layout_width="match_parent"
41+ android:layout_height="match_parent" />
9542
96- <LinearLayout
97- android:layout_width="624dip"
98- android:layout_height="wrap_content"
99- android:layout_centerHorizontal="true"
100- android:layout_below="@+id/timezone_auto_time"
101- android:layout_marginTop="48dip"
102- android:orientation="horizontal">
43+ </LinearLayout>
10344
104- <LinearLayout
105- android:layout_width="312dip"
106- android:layout_height="wrap_content"
107- android:orientation="vertical">
108- <TextView
109- android:id="@+id/date_picker_title"
110- android:layout_width="match_parent"
111- android:layout_height="48dip"
112- android:text="@string/date_picker_title"
113- android:textAppearance="?android:attr/textAppearanceMedium"
114- android:textSize="20dip"
115- android:clickable="false"
116- android:longClickable="false"
117- android:gravity="center" />
118- <DatePicker
119- android:id="@+id/date_picker"
120- android:layout_width="match_parent"
121- android:layout_height="wrap_content"
122- android:layout_below="@id/date_picker_title" />
123- </LinearLayout>
45+ <RelativeLayout android:layout_height="wrap_content"
46+ android:layout_weight="0"
47+ android:layout_width="match_parent">
12448
125- <!-- divider -->
12649 <View
127- android:id="@+id/center_divider"
128- android:layout_width="1dip"
129- android:layout_height="match_parent"
130- android:background="@color/divider_color" />
131-
132- <LinearLayout
133- android:layout_width="312dip"
134- android:layout_height="wrap_content"
135- android:orientation="vertical">
136- <TextView
137- android:id="@+id/time_picker_title"
138- android:layout_width="match_parent"
139- android:layout_height="48dip"
140- android:text="@string/time_picker_title"
141- android:textAppearance="?android:attr/textAppearanceMedium"
142- android:textSize="20dip"
143- android:gravity="center" />
144-
145- <TimePicker
146- android:id="@+id/time_picker"
147- android:layout_width="match_parent"
148- android:layout_height="wrap_content"
149- android:layout_below="@id/time_picker_title" />
150- </LinearLayout>
151- </LinearLayout>
50+ android:id="@+id/bottom_divider"
51+ android:layout_height="3dip"
52+ android:layout_width="match_parent"
53+ android:layout_marginTop="0dip"
54+ android:layout_marginBottom="16dip"
55+ android:background="@color/divider_color"
56+ android:layout_above="@+id/next_button"/>
57+
58+ <Button android:id="@+id/next_button"
59+ android:layout_width="wrap_content"
60+ android:minWidth="208dip"
61+ android:layout_height="48dip"
62+ android:layout_marginTop="10dip"
63+ android:layout_alignParentRight="true"
64+ android:text="@string/next_label"/>
15265
153- <View
154- android:id="@+id/bottom_divider"
155- android:layout_width="match_parent"
156- android:layout_height="3dip"
157- android:layout_alignLeft="@id/timezone_auto_time"
158- android:layout_above="@+id/next_button"
159- android:layout_marginBottom="16dip"
160- android:background="@color/divider_color" />
66+ </RelativeLayout>
16167
162- <Button
163- android:id="@+id/next_button"
164- style="@style/setup_wizard_button"
165- android:layout_alignParentBottom="true"
166- android:layout_alignParentRight="true"
167- android:text="@string/next_label" />
168-</RelativeLayout>
68+</LinearLayout>
--- a/res/layout-sw600dp-land/date_time_settings_setupwizard.xml
+++ b/res/layout-sw720dp/date_time_settings_setupwizard.xml
@@ -1,11 +1,11 @@
11 <?xml version="1.0" encoding="utf-8"?>
2-<!-- Copyright (C) 2010 The Android Open Source Project
2+<!-- Copyright (C) 2011 The Android Open Source Project
33
44 Licensed under the Apache License, Version 2.0 (the "License");
55 you may not use this file except in compliance with the License.
66 You may obtain a copy of the License at
77
8- http://www.apache.org/licenses/LICENSE-2.0
8+ http://www.apache.org/licenses/LICENSE-2.0
99
1010 Unless required by applicable law or agreed to in writing, software
1111 distributed under the License is distributed on an "AS IS" BASIS,
--- a/src/com/android/settings/DateTimeSettings.java
+++ b/src/com/android/settings/DateTimeSettings.java
@@ -60,6 +60,9 @@ public class DateTimeSettings extends SettingsPreferenceFragment
6060 private static final int DIALOG_DATEPICKER = 0;
6161 private static final int DIALOG_TIMEPICKER = 1;
6262
63+ // have we been launched from the setup wizard?
64+ protected static final String EXTRA_IS_FIRST_RUN = "firstRun";
65+
6366 private CheckBoxPreference mAutoTimePref;
6467 private Preference mTimePref;
6568 private Preference mTime24Pref;
@@ -81,15 +84,18 @@ public class DateTimeSettings extends SettingsPreferenceFragment
8184 boolean autoTimeEnabled = getAutoState(Settings.System.AUTO_TIME);
8285 boolean autoTimeZoneEnabled = getAutoState(Settings.System.AUTO_TIME_ZONE);
8386
87+ Intent intent = getActivity().getIntent();
88+ boolean isFirstRun = intent.getBooleanExtra(EXTRA_IS_FIRST_RUN, false);
89+
8490 mDummyDate = Calendar.getInstance();
8591 mDummyDate.set(mDummyDate.get(Calendar.YEAR), 11, 31, 13, 0, 0);
8692
8793 mAutoTimePref = (CheckBoxPreference) findPreference(KEY_AUTO_TIME);
8894 mAutoTimePref.setChecked(autoTimeEnabled);
8995 mAutoTimeZonePref = (CheckBoxPreference) findPreference(KEY_AUTO_TIME_ZONE);
90- // Override auto-timezone if it's a wifi-only device.
91- // TODO: Remove this when auto-timezone is implemented based on wifi-location.
92- if (Utils.isWifiOnly()) {
96+ // Override auto-timezone if it's a wifi-only device or if we're still in setup wizard.
97+ // TODO: Remove the wifiOnly test when auto-timezone is implemented based on wifi-location.
98+ if (Utils.isWifiOnly() || isFirstRun) {
9399 getPreferenceScreen().removePreference(mAutoTimeZonePref);
94100 autoTimeZoneEnabled = false;
95101 }
@@ -100,6 +106,10 @@ public class DateTimeSettings extends SettingsPreferenceFragment
100106 mTimeZone = findPreference("timezone");
101107 mDatePref = findPreference("date");
102108 mDateFormat = (ListPreference) findPreference(KEY_DATE_FORMAT);
109+ if (isFirstRun) {
110+ getPreferenceScreen().removePreference(mTime24Pref);
111+ getPreferenceScreen().removePreference(mDateFormat);
112+ }
103113
104114 String [] dateFormats = getResources().getStringArray(R.array.date_format_values);
105115 String [] formattedDates = new String[dateFormats.length];
@@ -158,7 +168,7 @@ public class DateTimeSettings extends SettingsPreferenceFragment
158168 .unregisterOnSharedPreferenceChangeListener(this);
159169 }
160170
161- private void updateTimeAndDateDisplay(Context context) {
171+ public void updateTimeAndDateDisplay(Context context) {
162172 java.text.DateFormat shortDateFormat = DateFormat.getDateFormat(context);
163173 final Calendar now = Calendar.getInstance();
164174 Date dummyDate = mDummyDate.getTime();
--- a/src/com/android/settings/DateTimeSettingsSetupWizard.java
+++ b/src/com/android/settings/DateTimeSettingsSetupWizard.java
@@ -18,6 +18,8 @@ package com.android.settings;
1818
1919 import android.app.Activity;
2020 import android.app.AlarmManager;
21+import android.app.Fragment;
22+import android.app.FragmentTransaction;
2123 import android.content.BroadcastReceiver;
2224 import android.content.Context;
2325 import android.content.Intent;
@@ -25,6 +27,8 @@ import android.content.IntentFilter;
2527 import android.content.pm.ActivityInfo;
2628 import android.content.res.Configuration;
2729 import android.os.Bundle;
30+import android.preference.Preference;
31+import android.preference.PreferenceFragment;
2832 import android.provider.Settings;
2933 import android.provider.Settings.SettingNotFoundException;
3034 import android.text.format.DateFormat;
@@ -39,6 +43,7 @@ import android.widget.Button;
3943 import android.widget.CompoundButton;
4044 import android.widget.CompoundButton.OnCheckedChangeListener;
4145 import android.widget.DatePicker;
46+import android.widget.LinearLayout;
4247 import android.widget.ListPopupWindow;
4348 import android.widget.SimpleAdapter;
4449 import android.widget.TimePicker;
@@ -47,14 +52,18 @@ import java.util.Calendar;
4752 import java.util.TimeZone;
4853
4954 public class DateTimeSettingsSetupWizard extends Activity
50- implements OnClickListener, OnItemClickListener, OnCheckedChangeListener{
55+ implements OnClickListener, OnItemClickListener, OnCheckedChangeListener,
56+ PreferenceFragment.OnPreferenceStartFragmentCallback {
5157 private static final String TAG = DateTimeSettingsSetupWizard.class.getSimpleName();
5258
5359 // force the first status of auto datetime flag.
5460 private static final String EXTRA_INITIAL_AUTO_DATETIME_VALUE =
5561 "extra_initial_auto_datetime_value";
5662
57- private boolean mXLargeScreenSize;
63+ // If we have enough screen real estate, we use a radically different layout with
64+ // big date and time pickers right on the screen, which requires very different handling.
65+ // Otherwise, we use the standard date time settings fragment.
66+ private boolean mUsingXLargeLayout;
5867
5968 /* Available only in XL */
6069 private CompoundButton mAutoDateTimeButton;
@@ -74,20 +83,25 @@ public class DateTimeSettingsSetupWizard extends Activity
7483 requestWindowFeature(Window.FEATURE_NO_TITLE);
7584 super.onCreate(savedInstanceState);
7685 setContentView(R.layout.date_time_settings_setupwizard);
77- mXLargeScreenSize = (getResources().getConfiguration().screenLayout
78- & Configuration.SCREENLAYOUT_SIZE_MASK)
79- >= Configuration.SCREENLAYOUT_SIZE_LARGE;
80- if (mXLargeScreenSize) {
86+
87+ // we know we've loaded the special xlarge layout because it has controls
88+ // not present in the standard layout
89+ mUsingXLargeLayout = findViewById(R.id.time_zone_button) != null;
90+ if (mUsingXLargeLayout) {
91+ setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
8192 initUiForXl();
8293 } else {
94+ setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT);
8395 findViewById(R.id.next_button).setOnClickListener(this);
8496 }
85- }
97+ mTimeZoneAdapter = ZonePicker.constructTimezoneAdapter(this, false,
98+ R.layout.date_time_setup_custom_list_item_2);
8699
87- public void initUiForXl() {
88100 final View layoutRoot = findViewById(R.id.layout_root);
89101 layoutRoot.setSystemUiVisibility(View.STATUS_BAR_DISABLE_BACK);
102+ }
90103
104+ public void initUiForXl() {
91105 // Currently just comment out codes related to auto timezone.
92106 // TODO: Remove them when we are sure they are unnecessary.
93107 /*
@@ -98,16 +112,12 @@ public class DateTimeSettingsSetupWizard extends Activity
98112 mAutoTimeZoneButton.setText(autoTimeZoneEnabled ? R.string.zone_auto_summaryOn :
99113 R.string.zone_auto_summaryOff);*/
100114
101- setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
102-
103115 final TimeZone tz = TimeZone.getDefault();
104116 mSelectedTimeZone = tz;
105117 mTimeZoneButton = (Button)findViewById(R.id.time_zone_button);
106118 mTimeZoneButton.setText(tz.getDisplayName());
107119 // mTimeZoneButton.setText(DateTimeSettings.getTimeZoneText(tz));
108120 mTimeZoneButton.setOnClickListener(this);
109- mTimeZoneAdapter = ZonePicker.constructTimezoneAdapter(this, false,
110- R.layout.date_time_setup_custom_list_item_2);
111121
112122 final boolean autoDateTimeEnabled;
113123 final Intent intent = getIntent();
@@ -158,22 +168,11 @@ public class DateTimeSettingsSetupWizard extends Activity
158168 public void onClick(View view) {
159169 switch (view.getId()) {
160170 case R.id.time_zone_button: {
161- mTimeZonePopup = new ListPopupWindow(this, null);
162- mTimeZonePopup.setWidth(mTimeZoneButton.getWidth());
163- mTimeZonePopup.setAnchorView(mTimeZoneButton);
164- mTimeZonePopup.setAdapter(mTimeZoneAdapter);
165- mTimeZonePopup.setOnItemClickListener(this);
166- mTimeZonePopup.setModal(true);
167- mTimeZonePopup.show();
171+ showTimezonePicker(R.id.time_zone_button);
168172 break;
169173 }
170174 case R.id.next_button: {
171- if (mXLargeScreenSize) {
172- /* Settings.System.putInt(getContentResolver(), Settings.System.AUTO_TIME_ZONE,
173- mAutoTimeZoneButton.isChecked() ? 1 : 0); */
174- Settings.System.putInt(getContentResolver(), Settings.System.AUTO_TIME,
175- mAutoDateTimeButton.isChecked() ? 1 : 0);
176-
175+ if (mSelectedTimeZone != null) {
177176 final TimeZone systemTimeZone = TimeZone.getDefault();
178177 if (!systemTimeZone.equals(mSelectedTimeZone)) {
179178 Log.i(TAG, "Another TimeZone is selected by a user. Changing system TimeZone.");
@@ -181,7 +180,10 @@ public class DateTimeSettingsSetupWizard extends Activity
181180 getSystemService(Context.ALARM_SERVICE);
182181 alarm.setTimeZone(mSelectedTimeZone.getID());
183182 }
184-
183+ }
184+ if (mAutoDateTimeButton != null) {
185+ Settings.System.putInt(getContentResolver(), Settings.System.AUTO_TIME,
186+ mAutoDateTimeButton.isChecked() ? 1 : 0);
185187 if (!mAutoDateTimeButton.isChecked()) {
186188 DateTimeSettings.setDate(mDatePicker.getYear(), mDatePicker.getMonth(),
187189 mDatePicker.getDayOfMonth());
@@ -203,7 +205,7 @@ public class DateTimeSettingsSetupWizard extends Activity
203205 final boolean autoEnabled = isChecked; // just for readibility.
204206 /*if (buttonView == mAutoTimeZoneButton) {
205207 // In XL screen, we save all the state only when the next button is pressed.
206- if (!mXLargeScreenSize) {
208+ if (!mUsingXLargeLayout) {
207209 Settings.System.putInt(getContentResolver(),
208210 Settings.System.AUTO_TIME_ZONE,
209211 isChecked ? 1 : 0);
@@ -233,18 +235,62 @@ public class DateTimeSettingsSetupWizard extends Activity
233235 @Override
234236 public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
235237 final TimeZone tz = ZonePicker.obtainTimeZoneFromItem(parent.getItemAtPosition(position));
236- mSelectedTimeZone = tz;
237-
238- final Calendar now = Calendar.getInstance(tz);
239- mTimeZoneButton.setText(tz.getDisplayName());
240- // mTimeZoneButton.setText(DateTimeSettings.getTimeZoneText(tz));
241- mDatePicker.updateDate(now.get(Calendar.YEAR), now.get(Calendar.MONTH),
242- now.get(Calendar.DAY_OF_MONTH));
243- mTimePicker.setCurrentHour(now.get(Calendar.HOUR_OF_DAY));
244- mTimePicker.setCurrentMinute(now.get(Calendar.MINUTE));
238+ if (mUsingXLargeLayout) {
239+ mSelectedTimeZone = tz;
240+ final Calendar now = Calendar.getInstance(tz);
241+ if (mTimeZoneButton != null) {
242+ mTimeZoneButton.setText(tz.getDisplayName());
243+ }
244+ // mTimeZoneButton.setText(DateTimeSettings.getTimeZoneText(tz));
245+ mDatePicker.updateDate(now.get(Calendar.YEAR), now.get(Calendar.MONTH),
246+ now.get(Calendar.DAY_OF_MONTH));
247+ mTimePicker.setCurrentHour(now.get(Calendar.HOUR_OF_DAY));
248+ mTimePicker.setCurrentMinute(now.get(Calendar.MINUTE));
249+ } else {
250+ // in prefs mode, we actually change the setting right now, as opposed to waiting
251+ // until Next is pressed in xLarge mode
252+ final AlarmManager alarm = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
253+ alarm.setTimeZone(tz.getID());
254+ DateTimeSettings settingsFragment = (DateTimeSettings) getFragmentManager().
255+ findFragmentById(R.id.date_time_settings_fragment);
256+ settingsFragment.updateTimeAndDateDisplay(this);
257+ }
245258 mTimeZonePopup.dismiss();
246259 }
247260
261+ /**
262+ * If this is called, that means we're in prefs style portrait mode for a large display
263+ * and the user has tapped on the time zone preference. If we were a PreferenceActivity,
264+ * we'd then launch the timezone fragment in a new activity, but we aren't, and here
265+ * on a tablet display, we really want more of a popup picker look' like the one we use
266+ * for the xlarge version of this activity. So we just take this opportunity to launch that.
267+ *
268+ * TODO: For phones, we might want to change this to do the "normal" opening
269+ * of the zonepicker fragment in its own activity. Or we might end up just
270+ * creating a separate DateTimeSettingsSetupWizardPhone activity that subclasses
271+ * PreferenceActivity in the first place to handle all that automatically.
272+ */
273+ @Override
274+ public boolean onPreferenceStartFragment(PreferenceFragment caller, Preference pref) {
275+ showTimezonePicker(R.id.timezone_dropdown_anchor);
276+ return true;
277+ }
278+
279+ private void showTimezonePicker(int anchorViewId) {
280+ View anchorView = findViewById(anchorViewId);
281+ if (anchorView == null) {
282+ Log.e(TAG, "Unable to find zone picker anchor view " + anchorViewId);
283+ return;
284+ }
285+ mTimeZonePopup = new ListPopupWindow(this, null);
286+ mTimeZonePopup.setWidth(anchorView.getWidth());
287+ mTimeZonePopup.setAnchorView(anchorView);
288+ mTimeZonePopup.setAdapter(mTimeZoneAdapter);
289+ mTimeZonePopup.setOnItemClickListener(this);
290+ mTimeZonePopup.setModal(true);
291+ mTimeZonePopup.show();
292+ }
293+
248294 private boolean isAutoDateTimeEnabled() {
249295 try {
250296 return Settings.System.getInt(getContentResolver(), Settings.System.AUTO_TIME) > 0;
@@ -264,6 +310,9 @@ public class DateTimeSettingsSetupWizard extends Activity
264310 }*/
265311
266312 private void updateTimeAndDateDisplay() {
313+ if (!mUsingXLargeLayout) {
314+ return;
315+ }
267316 final Calendar now = Calendar.getInstance();
268317 mTimeZoneButton.setText(now.getTimeZone().getDisplayName());
269318 mDatePicker.updateDate(now.get(Calendar.YEAR), now.get(Calendar.MONTH),