diff options
author | Freeman Ng <tenorslowworm@google.com> | 2011-06-02 15:44:51 -0700 |
---|---|---|
committer | Freeman Ng <tenorslowworm@google.com> | 2011-06-06 12:40:28 -0700 |
commit | 7f6f6e18c9f078323b15c8185a7e707194e7d155 (patch) | |
tree | 0b61aedc2909094c366cc7c4ba17f956d2cbf156 /res/layout-sw720dp | |
parent | 1f7014a25aad4cd3fe5e6f34eb30d936f4da2fd4 (diff) | |
download | packages_apps_Settings-7f6f6e18c9f078323b15c8185a7e707194e7d155.tar.gz packages_apps_Settings-7f6f6e18c9f078323b15c8185a7e707194e7d155.tar.bz2 packages_apps_Settings-7f6f6e18c9f078323b15c8185a7e707194e7d155.zip |
use prefs-style layout for setup wizard date/time settings on non-xlarge screens
Adjusted the screen size test to fall back to phone version of
DateTimeSettingsSetupWizard on large screens.
I made the following changes from how the phone version works:
1. Some layout changes. (Tablet look, bigger margins.)
2. Use zone picker to select time zone.
3. Added isFirstRun boolean extra to hide the pref fields
we don't need to see from setup wizard
Furthermore, I made the following fixes to the existing phone flow
(which had probably never yet been tried on a phone):
1. Added conditionals around access to some variables that only
exist in the xlarge layout.
2. Implemented PreferenceFragment.OnPreferenceStartFragmentCallback
in DateTimeSettingsSetupWizard in order to catch the user tapping
on the timezone preference and show the time zone picker popup.
(Note: for phones in ICS, we might want to launch the zone picker
preferences style, like it would have been had this been a
PreferenceActivity. Or maybe we should just create a separate
DateTimeSettingsSetupWizardPhone activity that subclasses
PreferencesActivity and doesn't need to play this trick.)
Change-Id: Ib5774a005c9f44d730d86c13746d91eb712141cc
Diffstat (limited to 'res/layout-sw720dp')
-rw-r--r-- | res/layout-sw720dp/date_time_settings_setupwizard.xml | 168 |
1 files changed, 168 insertions, 0 deletions
diff --git a/res/layout-sw720dp/date_time_settings_setupwizard.xml b/res/layout-sw720dp/date_time_settings_setupwizard.xml new file mode 100644 index 000000000..1fc25da5d --- /dev/null +++ b/res/layout-sw720dp/date_time_settings_setupwizard.xml @@ -0,0 +1,168 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2011 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> +<RelativeLayout + android:id="@+id/layout_root" + xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:paddingTop="@dimen/datetime_margin_top" + android:paddingLeft="@dimen/screen_margin_sides" + android:paddingRight="@dimen/screen_margin_sides" + android:paddingBottom="@dimen/datetime_margin_bottom"> + + <!-- Title: Set date & time--> + <TextView + android:id="@+id/title" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:minHeight="48dip" + android:layout_alignParentLeft="true" + android:layout_marginLeft="16dip" + android:layout_alignParentTop="true" + android:textSize="32dip" + android:textColor="#FF99cc00" + android:text="@string/date_and_time_settings_title_setup_wizard" + android:gravity="bottom" /> + + <!-- Divider --> + <View + android:id="@+id/top_divider" + android:layout_width="match_parent" + android:layout_height="3dip" + android:layout_below="@id/title" + android:layout_marginTop="6dip" + android:layout_marginBottom="17dip" + android:background="@color/divider_color" /> + + <RelativeLayout + android:id="@+id/timezone_auto_time" + android:layout_width="716dip" + android:layout_height="wrap_content" + android:layout_centerHorizontal="true" + android:layout_below="@id/top_divider"> + <!-- timezone --> + <Button + android:id="@+id/time_zone_button" + style="?android:attr/dropDownSpinnerStyle" + android:layout_width="304dip" + android:layout_height="48dip" + android:layout_alignParentLeft="true" + android:layout_alignBottom="@+id/date_time_auto" + android:gravity="left|center_vertical" + android:textAppearance="?android:attr/textAppearanceMedium" + android:textSize="20dip" /> + + <LinearLayout + android:id="@+id/date_time_auto" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="vertical" + android:layout_toRightOf="@id/time_zone_button" + android:layout_marginLeft="32dip" + android:layout_alignParentRight="true"> + + <Switch + android:id="@+id/date_time_auto_button" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:minHeight="?android:attr/listPreferredItemHeight" + android:layout_marginLeft="16dip" + android:text="@string/date_time_auto" + android:textAppearance="?android:attr/textAppearanceMedium" + android:textSize="20dip" /> + + <!-- Divider --> + <View + android:layout_width="match_parent" + android:layout_height="1px" + android:background="@color/divider_color" /> + </LinearLayout> + </RelativeLayout> + + <LinearLayout + android:layout_width="624dip" + android:layout_height="wrap_content" + android:layout_centerHorizontal="true" + android:layout_below="@+id/timezone_auto_time" + android:layout_marginTop="48dip" + android:orientation="horizontal"> + + <LinearLayout + android:layout_width="312dip" + android:layout_height="wrap_content" + android:orientation="vertical"> + <TextView + android:id="@+id/date_picker_title" + android:layout_width="match_parent" + android:layout_height="48dip" + android:text="@string/date_picker_title" + android:textAppearance="?android:attr/textAppearanceMedium" + android:textSize="20dip" + android:clickable="false" + android:longClickable="false" + android:gravity="center" /> + <DatePicker + android:id="@+id/date_picker" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_below="@id/date_picker_title" /> + </LinearLayout> + + <!-- divider --> + <View + android:id="@+id/center_divider" + android:layout_width="1dip" + android:layout_height="match_parent" + android:background="@color/divider_color" /> + + <LinearLayout + android:layout_width="312dip" + android:layout_height="wrap_content" + android:orientation="vertical"> + <TextView + android:id="@+id/time_picker_title" + android:layout_width="match_parent" + android:layout_height="48dip" + android:text="@string/time_picker_title" + android:textAppearance="?android:attr/textAppearanceMedium" + android:textSize="20dip" + android:gravity="center" /> + + <TimePicker + android:id="@+id/time_picker" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_below="@id/time_picker_title" /> + </LinearLayout> + </LinearLayout> + + <View + android:id="@+id/bottom_divider" + android:layout_width="match_parent" + android:layout_height="3dip" + android:layout_alignLeft="@id/timezone_auto_time" + android:layout_above="@+id/next_button" + android:layout_marginBottom="16dip" + android:background="@color/divider_color" /> + + <Button + android:id="@+id/next_button" + style="@style/setup_wizard_button" + android:layout_alignParentBottom="true" + android:layout_alignParentRight="true" + android:text="@string/next_label" /> +</RelativeLayout> |