SetupWizard: More refactor to match redlines

Change-Id: I74f422ba0c294d5e91aefb9356458c681cc53b37
This commit is contained in:
cretin45 2015-01-21 15:55:03 -08:00
parent 48ca24eb9b
commit 716ffa86dc
35 changed files with 822 additions and 602 deletions

View File

@ -1,8 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<set> <set xmlns:android="http://schemas.android.com/apk/res/android">
<translate xmlns:android="http://schemas.android.com/apk/res/android" <objectAnimator android:duration="@android:integer/config_mediumAnimTime"
android:fromXDelta="-100%" android:interpolator="@android:anim/accelerate_interpolator"
android:toXDelta="0" android:propertyName="x"
android:interpolator="@android:anim/decelerate_interpolator" android:valueFrom="1280"
android:duration="500"/> android:valueTo="0"
android:valueType="floatType"/>
</set> </set>

View File

@ -1,8 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<set> <set xmlns:android="http://schemas.android.com/apk/res/android">
<translate xmlns:android="http://schemas.android.com/apk/res/android" <objectAnimator android:duration="@android:integer/config_mediumAnimTime"
android:fromXDelta="0" android:interpolator="@android:anim/accelerate_interpolator"
android:toXDelta="100%" android:propertyName="x"
android:interpolator="@android:anim/decelerate_interpolator" android:valueFrom="0"
android:duration="500"/> android:valueTo="-1280"
android:valueType="floatType"/>
</set> </set>

View File

@ -16,5 +16,5 @@
--> -->
<shape xmlns:android="http://schemas.android.com/apk/res/android" > <shape xmlns:android="http://schemas.android.com/apk/res/android" >
<solid android:color="@color/divider" /> <solid android:color="@color/divider" />
<size android:width="316dp" android:height="1dp"/> <size android:width="316dp" android:height="1px"/>
</shape> </shape>

19
res/drawable/reveal.xml Normal file
View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2015 The CyanogenMod 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.
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<solid android:color="@color/page_background" />
</shape>

View File

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2015 The CyanogenMod 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 xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/header"
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="1"
android:paddingTop="@dimen/header_logo_margin_top"
style="@style/Header">
<ImageView
android:id="@+id/brand_logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/brand"
android:paddingLeft="@dimen/header_logo_margin_left"
android:paddingBottom="@dimen/header_logo_margin_bottom"
android:layout_alignParentTop="true"/>
<ImageView
android:id="@+id/powered_by_logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/powered_by"
android:visibility="gone"
android:paddingLeft="@dimen/header_logo_margin_left"
android:paddingBottom="@dimen/header_logo_margin_bottom"
android:layout_below="@+id/brand_logo"/>
<TextView
android:layout_width="match_parent"
android:layout_height="@dimen/page_title_height"
style="@style/PageTitle" />
</RelativeLayout>

View File

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2013 The CyanogenMod 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.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent">
<include layout="@layout/logo_header" />
<RelativeLayout android:id="@+id/page"
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:paddingLeft="@dimen/content_margin_left"
android:paddingRight="@dimen/content_margin_left"
style="@style/PageContent">
<com.cyanogenmod.setupwizard.ui.LocalePicker
android:id="@+id/locale_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="@dimen/min_locale_picker_height"
android:focusable="true"
android:focusableInTouchMode="true"
android:layout_centerInParent="true"/>
</RelativeLayout>
</LinearLayout>

View File

@ -14,31 +14,44 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
--> -->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:orientation="vertical"
android:layout_height="match_parent" android:layout_width="match_parent"
android:fillViewport="true"> android:layout_height="match_parent">
<LinearLayout <include layout="@layout/header" />
android:id="@+id/page_view"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView <FrameLayout android:id="@+id/page"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="0dp"
style="@style/PageSummaryText" android:layout_weight="1">
android:textSize="15sp"
android:paddingTop="@dimen/content_margin_top"
android:paddingLeft="@dimen/content_margin_left"
android:paddingRight="@dimen/content_margin_right"
android:paddingBottom="@dimen/summary_margin_bottom"
android:text="@string/choose_data_sim_summary" />
<include layout="@layout/divider" /> <ScrollView android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
</LinearLayout> <LinearLayout
</ScrollView> android:id="@+id/page_view"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/PageContent">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/PageSummaryText"
android:textSize="15sp"
android:paddingLeft="@dimen/content_margin_left"
android:paddingRight="@dimen/content_margin_right"
android:paddingBottom="@dimen/summary_margin_bottom"
android:text="@string/choose_data_sim_summary" />
<include layout="@layout/divider" />
</LinearLayout>
</ScrollView>
</FrameLayout>
</LinearLayout>

View File

@ -15,8 +15,10 @@
limitations under the License. limitations under the License.
--> -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/header"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/header_height"> android:layout_height="@dimen/header_height"
style="@style/Header">
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@ -15,8 +15,10 @@
limitations under the License. limitations under the License.
--> -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/header"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/page_title_height"> android:layout_height="@dimen/page_title_height"
style="@style/Header">
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@ -14,127 +14,145 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
--> -->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:orientation="vertical"
android:layout_height="match_parent" android:layout_width="match_parent"
android:fillViewport="true"> android:layout_height="match_parent">
<LinearLayout <include layout="@layout/header_condensed" />
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
style="@style/PageContent">
<TextView <FrameLayout android:id="@+id/page"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="0dp"
android:textSize="15sp" android:layout_weight="1">
android:layout_marginBottom="@dimen/summary_margin_bottom"
style="@style/PageSummaryText"
android:text="@string/location_services_summary" />
<LinearLayout <ScrollView android:layout_width="match_parent"
android:id="@+id/location" android:layout_height="match_parent"
android:orientation="horizontal" android:fillViewport="true">
android:layout_width="match_parent"
android:layout_height="wrap_content" <LinearLayout
android:layout_marginLeft="@dimen/location_margin_left" android:orientation="vertical"
android:layout_marginRight="@dimen/content_margin_right" android:layout_width="match_parent"
android:background="?android:attr/selectableItemBackground" android:layout_height="match_parent"
android:clickable="true"> style="@style/PageContent">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="15sp"
android:layout_marginBottom="@dimen/summary_margin_bottom"
android:paddingLeft="@dimen/content_margin_left"
android:paddingRight="@dimen/content_margin_right"
style="@style/PageSummaryText"
android:text="@string/location_services_summary" />
<LinearLayout
android:id="@+id/location"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/location_margin_left"
android:layout_marginRight="@dimen/content_margin_right"
android:background="?android:attr/selectableItemBackground"
android:clickable="true">
<CheckBox <CheckBox
android:id="@+id/location_checkbox" android:id="@+id/location_checkbox"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="top" android:layout_gravity="top"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:duplicateParentState="true" android:duplicateParentState="true"
android:clickable="false" /> android:clickable="false" />
<TextView <TextView
android:id="@+id/location_summary" android:id="@+id/location_summary"
android:layout_width="0px" android:layout_width="0px"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:textSize="15sp" android:textSize="15sp"
android:gravity="top" android:lineSpacingExtra="@dimen/setup_line_spacing"
android:layout_marginLeft="@dimen/location_text_margin_left" android:gravity="top"
android:layout_marginRight="@dimen/location_text_margin_right" android:layout_marginLeft="@dimen/location_text_margin_left"
android:paddingBottom="@dimen/content_margin_bottom" android:layout_marginRight="@dimen/location_text_margin_right"
android:text="@string/location_access_summary" android:paddingBottom="@dimen/content_margin_bottom"
android:maxLines="5" /> android:text="@string/location_access_summary"
android:maxLines="5" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/gps" android:id="@+id/gps"
android:orientation="horizontal" android:orientation="horizontal"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/location_margin_left" android:layout_marginLeft="@dimen/location_margin_left"
android:layout_marginRight="@dimen/content_margin_right" android:layout_marginRight="@dimen/content_margin_right"
android:background="?android:attr/selectableItemBackground" android:background="?android:attr/selectableItemBackground"
android:clickable="true"> android:clickable="true">
<CheckBox <CheckBox
android:id="@+id/gps_checkbox" android:id="@+id/gps_checkbox"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="top" android:layout_gravity="top"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:duplicateParentState="true" android:duplicateParentState="true"
android:clickable="false" /> android:clickable="false" />
<TextView <TextView
android:id="@+id/gps_summary" android:id="@+id/gps_summary"
android:layout_width="0px" android:layout_width="0px"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:textSize="15sp" android:textSize="15sp"
android:gravity="top" android:lineSpacingExtra="@dimen/setup_line_spacing"
android:layout_marginLeft="@dimen/location_text_margin_left" android:gravity="top"
android:layout_marginRight="@dimen/location_text_margin_right" android:layout_marginLeft="@dimen/location_text_margin_left"
android:paddingBottom="@dimen/content_margin_bottom" android:layout_marginRight="@dimen/location_text_margin_right"
android:text="@string/location_gps" android:paddingBottom="@dimen/content_margin_bottom"
android:maxLines="5" /> android:text="@string/location_gps"
android:maxLines="5" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/network" android:id="@+id/network"
android:orientation="horizontal" android:orientation="horizontal"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/location_margin_left" android:layout_marginLeft="@dimen/location_margin_left"
android:layout_marginRight="@dimen/content_margin_right" android:layout_marginRight="@dimen/content_margin_right"
android:background="?android:attr/selectableItemBackground" android:background="?android:attr/selectableItemBackground"
android:clickable="true"> android:clickable="true">
<CheckBox <CheckBox
android:id="@+id/network_checkbox" android:id="@+id/network_checkbox"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="top" android:layout_gravity="top"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:duplicateParentState="true" android:duplicateParentState="true"
android:clickable="false" /> android:clickable="false" />
<TextView <TextView
android:id="@+id/network_summary" android:id="@+id/network_summary"
android:layout_width="0px" android:layout_width="0px"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:textSize="15sp" android:textSize="15sp"
android:gravity="top" android:lineSpacingExtra="@dimen/setup_line_spacing"
android:layout_marginLeft="@dimen/location_text_margin_left" android:gravity="top"
android:layout_marginRight="@dimen/location_text_margin_right" android:layout_marginLeft="@dimen/location_text_margin_left"
android:paddingBottom="@dimen/content_margin_bottom" android:layout_marginRight="@dimen/location_text_margin_right"
android:text="@string/location_network" android:paddingBottom="@dimen/content_margin_bottom"
android:maxLines="5" /> android:text="@string/location_network"
android:maxLines="5" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>
</FrameLayout>
</LinearLayout>

View File

@ -15,8 +15,10 @@
limitations under the License. limitations under the License.
--> -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/header"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/logo_header_height"> android:layout_height="@dimen/logo_header_height"
style="@style/Header">
<ImageView <ImageView
android:id="@+id/brand_logo" android:id="@+id/brand_logo"

View File

@ -14,70 +14,83 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
--> -->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:orientation="vertical"
android:layout_height="match_parent" android:layout_width="match_parent"
android:fillViewport="true"> android:layout_height="match_parent">
<LinearLayout <include layout="@layout/header" />
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView <FrameLayout android:id="@+id/page"
android:id="@+id/mobile_data_summary" android:layout_width="match_parent"
android:layout_width="match_parent" android:layout_height="0dp"
android:layout_height="wrap_content" android:layout_weight="1">
style="@style/PageSummaryText"
android:textSize="15sp"
android:paddingTop="@dimen/content_margin_top"
android:paddingLeft="@dimen/content_margin_left"
android:paddingRight="@dimen/content_margin_right"
android:paddingBottom="@dimen/summary_margin_bottom"
android:text="@string/enable_mobile_data_summary" />
<include layout="@layout/divider" /> <ScrollView android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout <LinearLayout
android:id="@+id/data" android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeight"
android:gravity="center_vertical"
android:paddingLeft="@dimen/content_margin_left"
android:paddingRight="@dimen/data_switch_margin_right"
android:background="?android:attr/selectableItemBackground"
android:clickable="true">
<ImageView
android:id="@+id/signal"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:src="@drawable/ic_signal_0" /> style="@style/PageContent">
<TextView <TextView
android:id="@+id/enable_data_title" android:id="@+id/mobile_data_summary"
android:layout_width="0px" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" style="@style/PageSummaryText"
android:textSize="14sp" android:textSize="15sp"
android:layout_marginLeft="@dimen/carrier_text_margin_left" android:paddingLeft="@dimen/content_margin_left"
android:text="@string/setup_mobile_data_no_service" android:paddingRight="@dimen/content_margin_right"
android:maxLines="4" /> android:paddingBottom="@dimen/summary_margin_bottom"
android:text="@string/enable_mobile_data_summary" />
<Switch <include layout="@layout/divider" />
android:id="@+id/data_switch"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:duplicateParentState="true"
android:clickable="false"
android:textOff="@string/enable_mobile_off"
android:textOn="@string/enable_mobile_on"/>
</LinearLayout>
<include layout="@layout/divider" /> <LinearLayout
android:id="@+id/data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeight"
android:gravity="center_vertical"
android:paddingLeft="@dimen/content_margin_left"
android:paddingRight="@dimen/data_switch_margin_right"
android:background="?android:attr/selectableItemBackground"
android:clickable="true">
</LinearLayout> <ImageView
</ScrollView> android:id="@+id/signal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_signal_0" />
<TextView
android:id="@+id/enable_data_title"
android:layout_width="0px"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="14sp"
android:layout_marginLeft="@dimen/carrier_text_margin_left"
android:text="@string/setup_mobile_data_no_service"
android:maxLines="4" />
<Switch
android:id="@+id/data_switch"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:duplicateParentState="true"
android:clickable="false"
android:textOff="@string/enable_mobile_off"
android:textOn="@string/enable_mobile_on"/>
</LinearLayout>
<include layout="@layout/divider" />
</LinearLayout>
</ScrollView>
</FrameLayout>
</LinearLayout>

View File

@ -14,133 +14,152 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
--> -->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:orientation="vertical"
android:layout_height="match_parent" android:layout_width="match_parent"
android:fillViewport="true"> android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
style="@style/PageContent">
<!-- The caption about privacy policy -->
<TextView
android:id="@+id/privacy_policy"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="15sp"
android:layout_marginBottom="@dimen/summary_margin_bottom"
style="@style/PageSummaryText"
android:text="@string/services_explanation"
android:clickable="true"/>
<!-- Whether or not to enable metrics -->
<LinearLayout
android:id="@+id/metrics"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/location_margin_left"
android:layout_marginRight="@dimen/content_margin_right"
android:background="?android:attr/selectableItemBackground"
android:clickable="true">
<CheckBox <include layout="@layout/header_condensed" />
android:id="@+id/enable_metrics_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:layout_marginTop="5dp"
android:duplicateParentState="true"
android:clickable="false"/>
<TextView <FrameLayout android:id="@+id/page"
android:id="@+id/enable_metrics_summary" android:layout_width="match_parent"
android:layout_width="0px" android:layout_height="0dp"
android:layout_height="wrap_content" android:layout_weight="1">
android:layout_weight="1"
android:textSize="15sp"
android:gravity="top"
android:layout_marginLeft="@dimen/location_text_margin_left"
android:layout_marginRight="@dimen/location_text_margin_right"
android:paddingBottom="@dimen/content_margin_bottom"
android:text="@string/services_metrics_label"
android:maxLines="5" />
</LinearLayout> <ScrollView android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<!-- Checkbox for using on-screen nav keys --> <LinearLayout
<LinearLayout android:orientation="vertical"
android:id="@+id/nav_keys" android:layout_width="match_parent"
android:orientation="horizontal" android:layout_height="match_parent"
android:layout_width="match_parent" style="@style/PageContent">
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/location_margin_left"
android:layout_marginRight="@dimen/content_margin_right"
android:background="?android:attr/selectableItemBackground"
android:clickable="true">
<CheckBox <!-- The caption about privacy policy -->
android:id="@+id/nav_keys_checkbox" <TextView
android:layout_width="wrap_content" android:id="@+id/privacy_policy"
android:layout_height="wrap_content" android:layout_width="match_parent"
android:layout_gravity="top" android:layout_height="wrap_content"
android:layout_marginTop="5dp" android:textSize="15sp"
android:duplicateParentState="true" android:layout_marginBottom="@dimen/summary_margin_bottom"
android:clickable="false" /> android:paddingLeft="@dimen/content_margin_left"
android:paddingRight="@dimen/content_margin_right"
style="@style/PageSummaryText"
android:text="@string/services_explanation"
android:clickable="true"/>
<!-- Whether or not to enable metrics -->
<LinearLayout
android:id="@+id/metrics"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/location_margin_left"
android:layout_marginRight="@dimen/content_margin_right"
android:background="?android:attr/selectableItemBackground"
android:clickable="true">
<TextView <CheckBox
android:id="@+id/nav_keys_summary" android:id="@+id/enable_metrics_checkbox"
android:layout_width="0px" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_gravity="top"
android:textSize="15sp" android:layout_marginTop="5dp"
android:gravity="top" android:duplicateParentState="true"
android:layout_marginLeft="@dimen/location_text_margin_left" android:clickable="false"/>
android:layout_marginRight="@dimen/location_text_margin_right"
android:paddingBottom="@dimen/content_margin_bottom"
android:text="@string/services_os_nav_keys_label"
android:maxLines="5" />
</LinearLayout> <TextView
android:id="@+id/enable_metrics_summary"
android:layout_width="0px"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="15sp"
android:lineSpacingExtra="@dimen/setup_line_spacing"
android:gravity="top"
android:layout_marginLeft="@dimen/location_text_margin_left"
android:layout_marginRight="@dimen/location_text_margin_right"
android:paddingBottom="@dimen/content_margin_bottom"
android:text="@string/services_metrics_label"
android:maxLines="5" />
<!-- Checkbox for enabling secure SMS --> </LinearLayout>
<LinearLayout
android:id="@+id/secure_sms"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/location_margin_left"
android:layout_marginRight="@dimen/content_margin_right"
android:background="?android:attr/selectableItemBackground"
android:clickable="true">
<CheckBox <!-- Checkbox for using on-screen nav keys -->
android:id="@+id/secure_sms_checkbox" <LinearLayout
android:layout_width="wrap_content" android:id="@+id/nav_keys"
android:layout_height="wrap_content" android:orientation="horizontal"
android:layout_gravity="top" android:layout_width="match_parent"
android:layout_marginTop="5dp" android:layout_height="wrap_content"
android:duplicateParentState="true" android:layout_marginLeft="@dimen/location_margin_left"
android:clickable="false" /> android:layout_marginRight="@dimen/content_margin_right"
android:background="?android:attr/selectableItemBackground"
android:clickable="true">
<TextView <CheckBox
android:id="@+id/secure_sms_summary" android:id="@+id/nav_keys_checkbox"
android:layout_width="0px" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_gravity="top"
android:textSize="15sp" android:layout_marginTop="5dp"
android:gravity="top" android:duplicateParentState="true"
android:layout_marginLeft="@dimen/location_text_margin_left" android:clickable="false" />
android:layout_marginRight="@dimen/location_text_margin_right"
android:paddingBottom="@dimen/content_margin_bottom"
android:text="@string/services_secure_sms_label"
android:maxLines="5" />
</LinearLayout>
</LinearLayout> <TextView
</ScrollView> android:id="@+id/nav_keys_summary"
android:layout_width="0px"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="15sp"
android:lineSpacingExtra="@dimen/setup_line_spacing"
android:gravity="top"
android:layout_marginLeft="@dimen/location_text_margin_left"
android:layout_marginRight="@dimen/location_text_margin_right"
android:paddingBottom="@dimen/content_margin_bottom"
android:text="@string/services_os_nav_keys_label"
android:maxLines="5" />
</LinearLayout>
<!-- Checkbox for enabling secure SMS -->
<LinearLayout
android:id="@+id/secure_sms"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/location_margin_left"
android:layout_marginRight="@dimen/content_margin_right"
android:background="?android:attr/selectableItemBackground"
android:clickable="true">
<CheckBox
android:id="@+id/secure_sms_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:layout_marginTop="5dp"
android:duplicateParentState="true"
android:clickable="false" />
<TextView
android:id="@+id/secure_sms_summary"
android:layout_width="0px"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="15sp"
android:lineSpacingExtra="@dimen/setup_line_spacing"
android:gravity="top"
android:layout_marginLeft="@dimen/location_text_margin_left"
android:layout_marginRight="@dimen/location_text_margin_right"
android:paddingBottom="@dimen/content_margin_bottom"
android:text="@string/services_secure_sms_label"
android:maxLines="5" />
</LinearLayout>
</LinearLayout>
</ScrollView>
</FrameLayout>
</LinearLayout>

View File

@ -14,85 +14,100 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
--> -->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:orientation="vertical"
android:layout_height="match_parent" android:layout_width="match_parent"
android:fillViewport="true"> android:layout_height="match_parent">
<LinearLayout <include layout="@layout/header" />
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/PageContent">
<TextView <FrameLayout android:id="@+id/page"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="0dp"
style="@style/PageSummaryText" android:layout_weight="1">
android:textSize="16sp"
android:layout_marginBottom="@dimen/summary_margin_bottom"
android:paddingRight="@dimen/location_text_margin_right"
android:text="@string/date_time_summary" />
<Spinner <ScrollView android:layout_width="match_parent"
android:id="@+id/timezone_list" android:layout_height="match_parent"
android:layout_width="290dp" android:fillViewport="true">
android:layout_height="wrap_content"
android:saveEnabled="false"/>
<TwoLineListItem <LinearLayout
android:id="@+id/date_item" android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeight"
android:mode="twoLine"
android:clickable="true"
android:background="?android:attr/selectableItemBackground"
android:gravity="center_vertical">
<TextView
android:id="@+id/date_title"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/setup_current_date" android:paddingLeft="@dimen/content_margin_left"
style="@style/SpinnerItem" /> android:paddingRight="@dimen/content_margin_right"
style="@style/PageContent">
<TextView <TextView
android:id="@+id/date_text" android:layout_width="match_parent"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:layout_height="wrap_content" style="@style/PageSummaryText"
android:layout_below="@id/date_title" android:textSize="16sp"
android:layout_alignStart="@id/date_title" android:layout_marginBottom="@dimen/summary_margin_bottom"
android:fontFamily="sans-serif-medium" android:paddingRight="@dimen/location_text_margin_right"
style="@style/SpinnerItem" /> android:text="@string/date_time_summary" />
</TwoLineListItem>
<TwoLineListItem <Spinner
android:id="@+id/time_item" android:id="@+id/timezone_list"
android:layout_width="match_parent" android:layout_width="290dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeight" android:saveEnabled="false"/>
android:mode="twoLine"
android:clickable="true"
android:background="?android:attr/selectableItemBackground"
android:gravity="center_vertical">
<TextView <TwoLineListItem
android:id="@+id/time_title" android:id="@+id/date_item"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/setup_current_time" android:minHeight="?android:attr/listPreferredItemHeight"
style="@style/SpinnerItem" /> android:mode="twoLine"
android:clickable="true"
android:background="?android:attr/selectableItemBackground"
android:gravity="center_vertical">
<TextView <TextView
android:id="@+id/time_text" android:id="@+id/date_title"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@id/time_title" android:text="@string/setup_current_date"
android:layout_alignStart="@id/time_title" style="@style/SpinnerItem" />
android:fontFamily="sans-serif-medium"
style="@style/SpinnerItem" />
</TwoLineListItem>
</LinearLayout> <TextView
</ScrollView> android:id="@+id/date_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/date_title"
android:layout_alignStart="@id/date_title"
android:fontFamily="sans-serif-medium"
style="@style/SpinnerItem" />
</TwoLineListItem>
<TwoLineListItem
android:id="@+id/time_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeight"
android:mode="twoLine"
android:clickable="true"
android:background="?android:attr/selectableItemBackground"
android:gravity="center_vertical">
<TextView
android:id="@+id/time_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/setup_current_time"
style="@style/SpinnerItem" />
<TextView
android:id="@+id/time_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/time_title"
android:layout_alignStart="@id/time_title"
android:fontFamily="sans-serif-medium"
style="@style/SpinnerItem" />
</TwoLineListItem>
</LinearLayout>
</ScrollView>
</FrameLayout>
</LinearLayout>

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ProgressBar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:indeterminate="true"
style="@android:style/Widget.Material.ProgressBar.Horizontal" />
</LinearLayout>

View File

@ -17,16 +17,31 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent">
android:background="@color/primary">
<ImageView <FrameLayout android:id="@+id/page"
android:id="@+id/brand_logo" android:layout_width="match_parent"
android:layout_width="match_parent" android:layout_height="0dp"
android:layout_height="match_parent" android:layout_weight="1">
android:src="@drawable/brand_finish"
android:scaleType="centerInside"/>
</LinearLayout> <LinearLayout android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/primary">
<ImageView
android:id="@+id/brand_logo"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/brand_finish"
android:scaleType="centerInside"/>
</LinearLayout>
<ImageView android:id="@+id/reveal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/reveal"
android:visibility="invisible"/>
</FrameLayout>
</LinearLayout>

View File

@ -18,29 +18,14 @@
android:id="@+id/root" android:id="@+id/root"
android:orientation="vertical" android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent">
style="@style/RootView">
<LinearLayout android:id="@+id/page" <FrameLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
style="@style/PageContainer" >
<FrameLayout
android:id="@+id/header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/Header"/>
<FrameLayout
android:id="@+id/content" android:id="@+id/content"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1"/> android:layout_weight="1"
style="@style/PageContainer"/>
</LinearLayout>
<include layout="@layout/button_bar" /> <include layout="@layout/button_bar" />

View File

@ -14,19 +14,31 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
--> -->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/header" android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent">
style="@style/PageContent">
<com.cyanogenmod.setupwizard.ui.LocalePicker <include layout="@layout/logo_header" />
android:id="@+id/locale_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="12dp"
android:gravity="left"
android:focusable="true"
android:focusableInTouchMode="true"/>
</FrameLayout> <RelativeLayout android:id="@+id/page"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="center"
android:paddingLeft="@dimen/content_margin_left"
android:paddingRight="@dimen/content_margin_left"
style="@style/PageContent">
<com.cyanogenmod.setupwizard.ui.LocalePicker
android:id="@+id/locale_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="@dimen/min_locale_picker_height"
android:focusable="true"
android:focusableInTouchMode="true"
android:layout_centerInParent="true"/>
</RelativeLayout>
</LinearLayout>

View File

@ -14,36 +14,50 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
--> -->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:orientation="vertical"
android:layout_height="match_parent" android:layout_width="match_parent"
android:fillViewport="true"> android:layout_height="match_parent">
<LinearLayout <include layout="@layout/header" />
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView <FrameLayout android:id="@+id/page"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="0dp"
android:id="@+id/sim_missing" android:layout_weight="1">
style="@style/PageSummaryText"
android:textSize="15sp"
android:layout_marginBottom="@dimen/summary_margin_bottom"
android:paddingTop="@dimen/content_margin_top"
android:paddingLeft="@dimen/content_margin_left"
android:paddingRight="@dimen/content_margin_right"
android:text="@string/sim_missing_summary" />
<ImageView <ScrollView android:layout_width="match_parent"
android:layout_width="wrap_content" android:layout_height="match_parent"
android:layout_height="wrap_content" android:fillViewport="true">
android:layout_gravity="right"
android:src="@drawable/sim_back"/> <LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/PageContent">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/sim_missing"
style="@style/PageSummaryText"
android:textSize="15sp"
android:layout_marginBottom="@dimen/summary_margin_bottom"
android:paddingLeft="@dimen/content_margin_left"
android:paddingRight="@dimen/content_margin_right"
android:text="@string/sim_missing_summary" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:src="@drawable/sim_back"/>
</LinearLayout>
</ScrollView>
</FrameLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2013 The CyanogenMod 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.
-->
<resources>
<color name="status_bar">@color/primary_dark</color>
</resources>

View File

@ -15,5 +15,5 @@
limitations under the License. limitations under the License.
--> -->
<resources> <resources>
<dimen name="header_height">@dimen/page_title_height</dimen>
</resources> </resources>

View File

@ -20,10 +20,11 @@
<color name="window_background">#e4e7e8</color> <color name="window_background">#e4e7e8</color>
<color name="page_background">#efefef</color> <color name="page_background">#efefef</color>
<color name="primary">#2196f3</color> <color name="primary">#00B1E5</color>
<color name="primary_dark">#1481d8</color> <color name="primary_dark">#00A2E5</color>
<color name="accent">#009789</color> <color name="accent">#009789</color>
<color name="primary_text">#8a000000</color> <color name="primary_text">#8a000000</color>
<color name="secondary_text">#727272</color> <color name="secondary_text">#727272</color>
<color name="divider">#40000000</color> <color name="divider">#40000000</color>
<color name="status_bar">@color/primary</color>
</resources> </resources>

View File

@ -15,12 +15,13 @@
limitations under the License. limitations under the License.
--> -->
<resources> <resources>
<dimen name="logo_header_height">290dp</dimen> <dimen name="logo_header_height">220dp</dimen>
<dimen name="header_height">220dp</dimen> <dimen name="header_height">220dp</dimen>
<dimen name="page_title_height">56dp</dimen> <dimen name="page_title_height">56dp</dimen>
<dimen name="header_title_margin_left">26dp</dimen> <dimen name="header_title_margin_left">26dp</dimen>
<dimen name="header_logo_margin_left">25dp</dimen> <dimen name="header_logo_margin_left">25dp</dimen>
<dimen name="header_logo_margin_bottom">11dp</dimen> <dimen name="header_logo_margin_bottom">11dp</dimen>
<dimen name="header_logo_margin_top">30dp</dimen>
<dimen name="content_margin_top">26dp</dimen> <dimen name="content_margin_top">26dp</dimen>
<dimen name="content_margin_left">26dp</dimen> <dimen name="content_margin_left">26dp</dimen>
<dimen name="content_margin_right">14dp</dimen> <dimen name="content_margin_right">14dp</dimen>
@ -31,4 +32,6 @@
<dimen name="location_text_margin_right">30dp</dimen> <dimen name="location_text_margin_right">30dp</dimen>
<dimen name="data_switch_margin_right">30dp</dimen> <dimen name="data_switch_margin_right">30dp</dimen>
<dimen name="carrier_text_margin_left">15dp</dimen> <dimen name="carrier_text_margin_left">15dp</dimen>
<dimen name="setup_line_spacing">3sp</dimen>
<dimen name="min_locale_picker_height">100dp</dimen>
</resources> </resources>

View File

@ -49,9 +49,9 @@
<string name="date_time_summary">Set your time zone and adjust current date and time if needed</string> <string name="date_time_summary">Set your time zone and adjust current date and time if needed</string>
<string name="location_services_summary">Location services allows Maps and other apps to gather and use data such as your approximate location. For example, Maps may use your approximate location to locate nearby coffee shops.</string> <string name="location_services_summary">Location services allows Maps and other apps to gather and use data such as your approximate location. For example, Maps may use your approximate location to locate nearby coffee shops.</string>
<string name="location_access_summary">Allow apps that have asked your permission to use your location information. This may include your current location and past locations.</string> <string name="location_access_summary"><b>Allow apps that have asked your permission</b> to use your location information. This may include your current location and past locations.</string>
<string name="location_gps">Improve location accuracy by allowing apps to use the GPS on your phone.</string> <string name="location_gps"><b>Improve location accuracy</b> by allowing apps to use the GPS on your phone.</string>
<string name="location_network">Use Google\'s location service to help apps determine your location. This means sending annonymous location data to Google, even when no apps are running.</string> <string name="location_network"><b>Use Google\'s location service</b> to help apps determine your location. This means sending annonymous location data to Google, even when no apps are running.</string>
<string name="setup_mobile_data">Turn On Mobile Data</string> <string name="setup_mobile_data">Turn On Mobile Data</string>
<string name="setup_mobile_data_no_service">No service</string> <string name="setup_mobile_data_no_service">No service</string>

View File

@ -18,17 +18,15 @@
<style name="Theme.Setup" parent="@android:style/Theme.Material.Light"> <style name="Theme.Setup" parent="@android:style/Theme.Material.Light">
<item name="android:windowActionBar">false</item> <item name="android:windowActionBar">false</item>
<item name="android:windowNoTitle">true</item> <item name="android:windowNoTitle">true</item>
<item name="android:windowBackground">@color/primary</item>
<item name="android:windowActivityTransitions">true</item> <item name="android:windowActivityTransitions">true</item>
<item name="android:windowContentTransitions">true</item> <item name="android:windowContentTransitions">true</item>
<item name="android:windowExitTransition">@android:transition/explode</item>
<item name="android:colorPrimary">@color/primary</item> <item name="android:colorPrimary">@color/primary</item>
<item name="android:colorPrimaryDark">@color/primary</item> <item name="android:colorPrimaryDark">#00000000</item>
<item name="android:colorAccent">@color/accent</item> <item name="android:colorAccent">@color/accent</item>
</style> </style>
<style name="RootView">
<item name="android:background">@color/window_background</item>
</style>
<style name="Header"> <style name="Header">
<item name="android:elevation">4dp</item> <item name="android:elevation">4dp</item>
<item name="android:background">@color/primary</item> <item name="android:background">@color/primary</item>
@ -36,13 +34,11 @@
<style name="PageContainer"> <style name="PageContainer">
<item name="android:textColor">@color/primary_text</item> <item name="android:textColor">@color/primary_text</item>
<item name="android:background">@color/page_background</item>
</style> </style>
<style name="PageContent"> <style name="PageContent">
<item name="android:background">@color/page_background</item>
<item name="android:paddingTop">@dimen/content_margin_top</item> <item name="android:paddingTop">@dimen/content_margin_top</item>
<item name="android:paddingLeft">@dimen/content_margin_left</item>
<item name="android:paddingRight">@dimen/content_margin_right</item>
</style> </style>
<style name="PageTitle"> <style name="PageTitle">
@ -57,6 +53,7 @@
<style name="PageSummaryText"> <style name="PageSummaryText">
<item name="android:id">@android:id/summary</item> <item name="android:id">@android:id/summary</item>
<item name="android:lineSpacingExtra">@dimen/setup_line_spacing</item>
</style> </style>
<style name="SpinnerItem"> <style name="SpinnerItem">

View File

@ -18,7 +18,6 @@ package com.cyanogenmod.setupwizard.setup;
import android.content.Context; import android.content.Context;
import android.os.Bundle; import android.os.Bundle;
import android.view.LayoutInflater;
import java.util.ArrayList; import java.util.ArrayList;
@ -104,10 +103,6 @@ public abstract class AbstractSetupData implements SetupDataCallbacks {
} }
} }
@Override
public void onPageViewCreated(LayoutInflater inflater, Bundle savedInstanceState,
int layoutResource) {}
private boolean advanceToNextUncompleted() { private boolean advanceToNextUncompleted() {
while (mCurrentPageIndex < mPageList.size()) { while (mCurrentPageIndex < mPageList.size()) {
mCurrentPageIndex++; mCurrentPageIndex++;

View File

@ -17,8 +17,6 @@
package com.cyanogenmod.setupwizard.setup; package com.cyanogenmod.setupwizard.setup;
import android.accounts.AccountManager; import android.accounts.AccountManager;
import android.accounts.AccountManagerCallback;
import android.accounts.AccountManagerFuture;
import android.app.Activity; import android.app.Activity;
import android.app.Fragment; import android.app.Fragment;
import android.content.Context; import android.content.Context;
@ -137,8 +135,6 @@ public class CyanogenServicesPage extends SetupPage {
private CheckBox mNavKeys; private CheckBox mNavKeys;
private CheckBox mSecureSms; private CheckBox mSecureSms;
private Runnable mDeferredAction;
private Handler mHandler; private Handler mHandler;
@ -250,23 +246,10 @@ public class CyanogenServicesPage extends SetupPage {
return R.layout.setup_cyanogen_services; return R.layout.setup_cyanogen_services;
} }
@Override
protected int getHeaderLayoutResource() {
return R.layout.header_condensed;
}
@Override @Override
public void onResume() { public void onResume() {
super.onResume(); super.onResume();
updateDisableNavkeysOption(); updateDisableNavkeysOption();
runDeferredAction();
}
private void runDeferredAction() {
if (mDeferredAction != null) {
mDeferredAction.run();
mDeferredAction = null;
}
} }
private void updateDisableNavkeysOption() { private void updateDisableNavkeysOption() {
@ -279,28 +262,9 @@ public class CyanogenServicesPage extends SetupPage {
private void launchCyanogenAccountSetup(final Activity activity) { private void launchCyanogenAccountSetup(final Activity activity) {
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
bundle.putBoolean(SetupWizardApp.EXTRA_FIRST_RUN, true); bundle.putBoolean(SetupWizardApp.EXTRA_FIRST_RUN, true);
AccountManager AccountManager.get(activity)
.get(activity).addAccount(SetupWizardApp.ACCOUNT_TYPE_CYANOGEN, null, null, bundle, .addAccount(SetupWizardApp.ACCOUNT_TYPE_CYANOGEN, null, null, bundle,
activity, new AccountManagerCallback<Bundle>() { activity, null, null);
@Override
public void run(AccountManagerFuture<Bundle> bundleAccountManagerFuture) {
if (activity == null) return; //There is a chance this activity has been torn down.
Runnable runnable = new Runnable() {
@Override
public void run() {
if (!SetupWizardUtils.accountExists(activity,
SetupWizardApp.ACCOUNT_TYPE_CYANOGEN)) {
mPage.getCallbacks().onNextPage();
}
}
};
if (activity.isResumed()) {
runnable.run();
} else {
mDeferredAction = runnable;
}
}
}, null);
} }
} }

View File

@ -19,14 +19,20 @@ package com.cyanogenmod.setupwizard.setup;
import com.cyanogenmod.setupwizard.R; import com.cyanogenmod.setupwizard.R;
import com.cyanogenmod.setupwizard.ui.SetupPageFragment; import com.cyanogenmod.setupwizard.ui.SetupPageFragment;
import android.animation.Animator;
import android.app.Fragment; import android.app.Fragment;
import android.content.Context; import android.content.Context;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.view.ViewAnimationUtils;
public class FinishPage extends SetupPage { public class FinishPage extends SetupPage {
public static final String TAG = "FinishPage"; public static final String TAG = "FinishPage";
private FinishFragment mFinishFragment;
public FinishPage(Context context, SetupDataCallbacks callbacks) { public FinishPage(Context context, SetupDataCallbacks callbacks) {
super(context, callbacks); super(context, callbacks);
} }
@ -36,9 +42,9 @@ public class FinishPage extends SetupPage {
Bundle args = new Bundle(); Bundle args = new Bundle();
args.putString(SetupPage.KEY_PAGE_ARGUMENT, getKey()); args.putString(SetupPage.KEY_PAGE_ARGUMENT, getKey());
FinishFragment fragment = new FinishFragment(); mFinishFragment = new FinishFragment();
fragment.setArguments(args); mFinishFragment.setArguments(args);
return fragment; return mFinishFragment;
} }
@Override @Override
@ -53,7 +59,7 @@ public class FinishPage extends SetupPage {
@Override @Override
public boolean doNextAction() { public boolean doNextAction() {
getCallbacks().onFinish(); mFinishFragment.animateOut(getCallbacks());
return true; return true;
} }
@ -69,18 +75,58 @@ public class FinishPage extends SetupPage {
public static class FinishFragment extends SetupPageFragment { public static class FinishFragment extends SetupPageFragment {
private View mReveal;
private Handler mHandler;
@Override @Override
protected void initializePage() {} public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
mHandler = new Handler();
getActivity().getWindow().setStatusBarColor(getResources().getColor(R.color.primary));
}
@Override
protected void initializePage() {
mReveal = mRootView.findViewById(R.id.reveal);
}
private void animateOut(final SetupDataCallbacks callbacks) {
int cx = (mReveal.getLeft() + mReveal.getRight()) / 2;
int cy = (mReveal.getTop() + mReveal.getBottom()) / 2;
int finalRadius = Math.max(mReveal.getWidth(), mReveal.getHeight());
Animator anim =
ViewAnimationUtils.createCircularReveal(mReveal, cx, cy, 0, finalRadius);
anim.addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
mReveal.setVisibility(View.VISIBLE);
}
@Override
public void onAnimationEnd(Animator animation) {
mHandler.post(new Runnable() {
@Override
public void run() {
callbacks.onFinish();
}
});
}
@Override
public void onAnimationCancel(Animator animation) {}
@Override
public void onAnimationRepeat(Animator animation) {}
});
anim.start();
}
@Override @Override
protected int getLayoutResource() { protected int getLayoutResource() {
return R.layout.setup_finished_page; return R.layout.setup_finished_page;
} }
@Override
protected int getHeaderLayoutResource() {
return -1;
}
} }
} }

View File

@ -127,11 +127,6 @@ public class LocationSettingsPage extends SetupPage {
return R.layout.location_settings; return R.layout.location_settings;
} }
@Override
protected int getHeaderLayoutResource() {
return R.layout.header_condensed;
}
@Override @Override
public void onResume() { public void onResume() {
super.onResume(); super.onResume();

View File

@ -16,9 +16,6 @@
package com.cyanogenmod.setupwizard.setup; package com.cyanogenmod.setupwizard.setup;
import android.os.Bundle;
import android.view.LayoutInflater;
public interface SetupDataCallbacks { public interface SetupDataCallbacks {
void onNextPage(); void onNextPage();
void onPreviousPage(); void onPreviousPage();
@ -27,5 +24,4 @@ public interface SetupDataCallbacks {
void onFinish(); void onFinish();
Page getPage(String key); Page getPage(String key);
Page getPage(int key); Page getPage(int key);
void onPageViewCreated(LayoutInflater inflater, Bundle savedInstanceState, int layoutResource);
} }

View File

@ -21,10 +21,12 @@ import com.cyanogenmod.setupwizard.R;
import android.app.Activity; import android.app.Activity;
import android.app.Fragment; import android.app.Fragment;
import android.app.FragmentManager; import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.transition.Slide;
import android.transition.Transition;
import android.view.Gravity;
public abstract class SetupPage implements Page { public abstract class SetupPage implements Page {
@ -71,14 +73,19 @@ public abstract class SetupPage implements Page {
public void doLoadAction(Activity context, int action) { public void doLoadAction(Activity context, int action) {
if (context == null || context.isFinishing()) { return; } if (context == null || context.isFinishing()) { return; }
final FragmentManager fragmentManager = context.getFragmentManager(); final FragmentManager fragmentManager = context.getFragmentManager();
Fragment fragment = getFragment();
if (action == Page.ACTION_NEXT) { if (action == Page.ACTION_NEXT) {
FragmentTransaction transaction = fragmentManager.beginTransaction(); Transition t = new Slide(Gravity.RIGHT);
transaction.replace(R.id.content, getFragment(), getKey()); fragment.setEnterTransition(t);
transaction.commit(); fragmentManager.beginTransaction()
.replace(R.id.content,fragment, getKey())
.commit();
} else { } else {
FragmentTransaction transaction = fragmentManager.beginTransaction(); Transition t = new Slide(Gravity.LEFT);
transaction.replace(R.id.content, getFragment(), getKey()); fragment.setEnterTransition(t);
transaction.commit(); fragmentManager.beginTransaction()
.replace(R.id.content, fragment, getKey())
.commit();
} }
} }

View File

@ -96,6 +96,12 @@ public class WelcomePage extends SetupPage {
} }
}; };
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
getActivity().getWindow().setStatusBarColor(getResources().getColor(R.color.primary));
}
@Override @Override
protected void initializePage() { protected void initializePage() {
mLanguagePicker = (LocalePicker) mRootView.findViewById(R.id.locale_list); mLanguagePicker = (LocalePicker) mRootView.findViewById(R.id.locale_list);
@ -152,10 +158,6 @@ public class WelcomePage extends SetupPage {
return R.layout.setup_welcome_page; return R.layout.setup_welcome_page;
} }
@Override
protected int getHeaderLayoutResource() {
return R.layout.logo_header;
}
} }
} }

View File

@ -585,11 +585,7 @@ public class LocalePicker extends LinearLayout {
mSelectionDivider = context.getDrawable(com.cyanogenmod.setupwizard.R.drawable.divider); mSelectionDivider = context.getDrawable(com.cyanogenmod.setupwizard.R.drawable.divider);
final int defSelectionDividerHeight = (int) TypedValue.applyDimension( mSelectionDividerHeight = UNSCALED_DEFAULT_SELECTION_DIVIDER_HEIGHT;
TypedValue.COMPLEX_UNIT_DIP, UNSCALED_DEFAULT_SELECTION_DIVIDER_HEIGHT,
getResources().getDisplayMetrics());
mSelectionDividerHeight = attributesArray.getDimensionPixelSize(
R.styleable.NumberPicker_selectionDividerHeight, defSelectionDividerHeight);
final int defSelectionDividerDistance = (int) TypedValue.applyDimension( final int defSelectionDividerDistance = (int) TypedValue.applyDimension(
TypedValue.COMPLEX_UNIT_DIP, UNSCALED_DEFAULT_SELECTION_DIVIDERS_DISTANCE, TypedValue.COMPLEX_UNIT_DIP, UNSCALED_DEFAULT_SELECTION_DIVIDERS_DISTANCE,

View File

@ -22,6 +22,7 @@ import android.os.Bundle;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.TextView;
import com.cyanogenmod.setupwizard.R; import com.cyanogenmod.setupwizard.R;
import com.cyanogenmod.setupwizard.setup.Page; import com.cyanogenmod.setupwizard.setup.Page;
@ -33,6 +34,8 @@ public abstract class SetupPageFragment extends Fragment {
protected String mKey; protected String mKey;
protected Page mPage; protected Page mPage;
protected View mRootView; protected View mRootView;
protected TextView mTitleView;
protected ViewGroup mHeaderView;
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
@ -48,7 +51,9 @@ public abstract class SetupPageFragment extends Fragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container, public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) { Bundle savedInstanceState) {
mRootView = inflater.inflate(getLayoutResource(), container, false); mRootView = inflater.inflate(getLayoutResource(), container, false);
mCallbacks.onPageViewCreated(inflater, savedInstanceState, getHeaderLayoutResource()); mTitleView = (TextView) mRootView.findViewById(android.R.id.title);
mHeaderView = (ViewGroup ) mRootView.findViewById(R.id.header);
getActivity().startPostponedEnterTransition();
return mRootView; return mRootView;
} }
@ -56,9 +61,12 @@ public abstract class SetupPageFragment extends Fragment {
public void onActivityCreated(Bundle savedInstanceState) { public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState); super.onActivityCreated(savedInstanceState);
mPage = mCallbacks.getPage(mKey); mPage = mCallbacks.getPage(mKey);
if (mTitleView != null) {
mTitleView.setText(mPage.getTitleResId());
}
initializePage(); initializePage();
mCallbacks.onPageLoaded(mPage); mCallbacks.onPageLoaded(mPage);
getActivity().getWindow().setStatusBarColor(getResources().getColor(R.color.primary)); getActivity().getWindow().setStatusBarColor(getResources().getColor(R.color.status_bar));
} }
@Override @Override
@ -76,10 +84,6 @@ public abstract class SetupPageFragment extends Fragment {
mCallbacks = null; mCallbacks = null;
} }
protected int getHeaderLayoutResource() {
return R.layout.header;
}
protected abstract void initializePage(); protected abstract void initializePage();
protected abstract int getLayoutResource(); protected abstract int getLayoutResource();

View File

@ -19,7 +19,9 @@ package com.cyanogenmod.setupwizard.ui;
import android.app.Activity; import android.app.Activity;
import android.app.AppGlobals; import android.app.AppGlobals;
import android.content.Intent; import android.content.Intent;
import android.content.res.Configuration;
import android.content.res.Resources; import android.content.res.Resources;
import android.graphics.drawable.GradientDrawable;
import android.os.Bundle; import android.os.Bundle;
import android.provider.Settings; import android.provider.Settings;
import android.util.Log; import android.util.Log;
@ -45,11 +47,8 @@ public class SetupWizardActivity extends Activity implements SetupDataCallbacks
private static final String TAG = SetupWizardActivity.class.getSimpleName(); private static final String TAG = SetupWizardActivity.class.getSimpleName();
private View mRootView; private View mRootView;
private View mPageView;
private Button mNextButton; private Button mNextButton;
private Button mPrevButton; private Button mPrevButton;
private TextView mTitleView;
private ViewGroup mHeaderView;
private AbstractSetupData mSetupData; private AbstractSetupData mSetupData;
@ -57,13 +56,11 @@ public class SetupWizardActivity extends Activity implements SetupDataCallbacks
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.setup_main); setContentView(R.layout.setup_main);
mRootView = findViewById(R.id.root); mRootView = findViewById(R.id.root);
mPageView = findViewById(R.id.page);
((SetupWizardApp)getApplicationContext()).disableStatusBar(); ((SetupWizardApp)getApplicationContext()).disableStatusBar();
mSetupData = (AbstractSetupData)getLastNonConfigurationInstance(); mSetupData = (AbstractSetupData)getLastNonConfigurationInstance();
if (mSetupData == null) { if (mSetupData == null) {
mSetupData = new CMSetupWizardData(this); mSetupData = new CMSetupWizardData(this);
} }
mHeaderView = (ViewGroup)findViewById(R.id.header);
mNextButton = (Button) findViewById(R.id.next_button); mNextButton = (Button) findViewById(R.id.next_button);
mPrevButton = (Button) findViewById(R.id.prev_button); mPrevButton = (Button) findViewById(R.id.prev_button);
mSetupData.registerListener(this); mSetupData.registerListener(this);
@ -118,24 +115,9 @@ public class SetupWizardActivity extends Activity implements SetupDataCallbacks
@Override @Override
public void onBackPressed() { public void onBackPressed() {
mSetupData.onPreviousPage(); if (!mSetupData.isFirstPage()) {
} mSetupData.onPreviousPage();
}
@Override
public void onPageViewCreated(LayoutInflater inflater, Bundle savedInstanceState,
int layoutResource) {
if (layoutResource != -1) {
mHeaderView.setVisibility(View.VISIBLE);
mHeaderView.removeAllViews();
inflater.inflate(layoutResource, mHeaderView, true);
} else {
mHeaderView.setVisibility(View.GONE);
}
mTitleView = (TextView) findViewById(android.R.id.title);
if (mTitleView != null) {
Page page = mSetupData.getCurrentPage();
mTitleView.setText(page.getTitleResId());
}
} }
@Override @Override
@ -152,6 +134,14 @@ public class SetupWizardActivity extends Activity implements SetupDataCallbacks
@Override @Override
public void onPageLoaded(Page page) { public void onPageLoaded(Page page) {
if (getResources().getConfiguration().orientation
== Configuration.ORIENTATION_LANDSCAPE &&
mSetupData.isFirstPage()) {
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
| View.SYSTEM_UI_FLAG_FULLSCREEN);
} else {
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
}
updateButtonBar(); updateButtonBar();
} }
@ -179,18 +169,12 @@ public class SetupWizardActivity extends Activity implements SetupDataCallbacks
if (mSetupData.isLastPage()) { if (mSetupData.isLastPage()) {
mPrevButton.setVisibility(View.INVISIBLE); mPrevButton.setVisibility(View.INVISIBLE);
mRootView.setBackgroundColor(resources.getColor(R.color.primary)); mRootView.setBackgroundColor(resources.getColor(R.color.primary));
mPageView.setBackgroundColor(resources.getColor(R.color.primary));
mNextButton.setCompoundDrawablesWithIntrinsicBounds(null, null, mNextButton.setCompoundDrawablesWithIntrinsicBounds(null, null,
getDrawable(R.drawable.ic_chevron_right_wht), null); getDrawable(R.drawable.ic_chevron_right_wht), null);
mNextButton.setTextColor(resources.getColor(R.color.white)); mNextButton.setTextColor(resources.getColor(R.color.white));
} else { } else {
mPrevButton.setVisibility(View.VISIBLE); mPrevButton.setVisibility(View.VISIBLE);
mPageView.setBackgroundColor(resources.getColor(R.color.page_background)); mRootView.setBackgroundColor(resources.getColor(R.color.window_background));
if (mSetupData.isFirstPage()) {
mRootView.setBackgroundColor(resources.getColor(R.color.page_background));
} else {
mRootView.setBackgroundColor(resources.getColor(R.color.window_background));
}
mNextButton.setCompoundDrawablesWithIntrinsicBounds(null, null, mNextButton.setCompoundDrawablesWithIntrinsicBounds(null, null,
getDrawable(R.drawable.ic_chevron_right_dark), null); getDrawable(R.drawable.ic_chevron_right_dark), null);
mNextButton.setTextColor(resources.getColor(R.color.primary_text)); mNextButton.setTextColor(resources.getColor(R.color.primary_text));