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"?>
<set>
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:fromXDelta="-100%"
android:toXDelta="0"
android:interpolator="@android:anim/decelerate_interpolator"
android:duration="500"/>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<objectAnimator android:duration="@android:integer/config_mediumAnimTime"
android:interpolator="@android:anim/accelerate_interpolator"
android:propertyName="x"
android:valueFrom="1280"
android:valueTo="0"
android:valueType="floatType"/>
</set>

View File

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

View File

@ -16,5 +16,5 @@
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<solid android:color="@color/divider" />
<size android:width="316dp" android:height="1dp"/>
<size android:width="316dp" android:height="1px"/>
</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
limitations under the License.
-->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/page_view"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<include layout="@layout/header" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
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/choose_data_sim_summary" />
<FrameLayout android:id="@+id/page"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<include layout="@layout/divider" />
<ScrollView android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
</LinearLayout>
</ScrollView>
<LinearLayout
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.
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/header"
android:layout_width="match_parent"
android:layout_height="@dimen/header_height">
android:layout_height="@dimen/header_height"
style="@style/Header">
<TextView
android:layout_width="match_parent"

View File

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

View File

@ -14,127 +14,145 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
style="@style/PageContent">
<include layout="@layout/header_condensed" />
<TextView
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/location_services_summary" />
<FrameLayout android:id="@+id/page"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<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">
<ScrollView android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
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
android:id="@+id/location_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" />
<CheckBox
android:id="@+id/location_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/location_summary"
android:layout_width="0px"
android:layout_height="wrap_content"
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/location_access_summary"
android:maxLines="5" />
<TextView
android:id="@+id/location_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/location_access_summary"
android:maxLines="5" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/gps"
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">
<LinearLayout
android:id="@+id/gps"
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/gps_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" />
<CheckBox
android:id="@+id/gps_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/gps_summary"
android:layout_width="0px"
android:layout_height="wrap_content"
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/location_gps"
android:maxLines="5" />
<TextView
android:id="@+id/gps_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/location_gps"
android:maxLines="5" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/network"
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">
<LinearLayout
android:id="@+id/network"
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/network_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" />
<CheckBox
android:id="@+id/network_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/network_summary"
android:layout_width="0px"
android:layout_height="wrap_content"
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/location_network"
android:maxLines="5" />
<TextView
android:id="@+id/network_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/location_network"
android:maxLines="5" />
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
</LinearLayout>
</ScrollView>
</FrameLayout>
</LinearLayout>

View File

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

View File

@ -14,70 +14,83 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<include layout="@layout/header" />
<TextView
android:id="@+id/mobile_data_summary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
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" />
<FrameLayout android:id="@+id/page"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<include layout="@layout/divider" />
<ScrollView android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<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">
<ImageView
android:id="@+id/signal"
android:layout_width="wrap_content"
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/ic_signal_0" />
style="@style/PageContent">
<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" />
<TextView
android:id="@+id/mobile_data_summary"
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/enable_mobile_data_summary" />
<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" />
<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>
</ScrollView>
<ImageView
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
limitations under the License.
-->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<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">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<CheckBox
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"/>
<include layout="@layout/header_condensed" />
<TextView
android:id="@+id/enable_metrics_summary"
android:layout_width="0px"
android:layout_height="wrap_content"
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" />
<FrameLayout android:id="@+id/page"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
</LinearLayout>
<ScrollView android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<!-- Checkbox for using on-screen nav keys -->
<LinearLayout
android:id="@+id/nav_keys"
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">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
style="@style/PageContent">
<CheckBox
android:id="@+id/nav_keys_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" />
<!-- 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"
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
android:id="@+id/nav_keys_summary"
android:layout_width="0px"
android:layout_height="wrap_content"
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_os_nav_keys_label"
android:maxLines="5" />
<CheckBox
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"/>
</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
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">
</LinearLayout>
<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" />
<!-- Checkbox for using on-screen nav keys -->
<LinearLayout
android:id="@+id/nav_keys"
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
android:id="@+id/secure_sms_summary"
android:layout_width="0px"
android:layout_height="wrap_content"
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_secure_sms_label"
android:maxLines="5" />
<CheckBox
android:id="@+id/nav_keys_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" />
</LinearLayout>
</LinearLayout>
</ScrollView>
<TextView
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
limitations under the License.
-->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/PageContent">
<include layout="@layout/header" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/PageSummaryText"
android:textSize="16sp"
android:layout_marginBottom="@dimen/summary_margin_bottom"
android:paddingRight="@dimen/location_text_margin_right"
android:text="@string/date_time_summary" />
<FrameLayout android:id="@+id/page"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<Spinner
android:id="@+id/timezone_list"
android:layout_width="290dp"
android:layout_height="wrap_content"
android:saveEnabled="false"/>
<ScrollView android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<TwoLineListItem
android:id="@+id/date_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/date_title"
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/setup_current_date"
style="@style/SpinnerItem" />
android:paddingLeft="@dimen/content_margin_left"
android:paddingRight="@dimen/content_margin_right"
style="@style/PageContent">
<TextView
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>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/PageSummaryText"
android:textSize="16sp"
android:layout_marginBottom="@dimen/summary_margin_bottom"
android:paddingRight="@dimen/location_text_margin_right"
android:text="@string/date_time_summary" />
<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">
<Spinner
android:id="@+id/timezone_list"
android:layout_width="290dp"
android:layout_height="wrap_content"
android:saveEnabled="false"/>
<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" />
<TwoLineListItem
android:id="@+id/date_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_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>
<TextView
android:id="@+id/date_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/setup_current_date"
style="@style/SpinnerItem" />
</LinearLayout>
</ScrollView>
<TextView
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"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/primary">
android:layout_height="match_parent">
<ImageView
android:id="@+id/brand_logo"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/brand_finish"
android:scaleType="centerInside"/>
<FrameLayout android:id="@+id/page"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
</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:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
style="@style/RootView">
android:layout_height="match_parent">
<LinearLayout android:id="@+id/page"
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
<FrameLayout
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"/>
</LinearLayout>
android:layout_weight="1"
style="@style/PageContainer"/>
<include layout="@layout/button_bar" />

View File

@ -14,19 +14,31 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/header"
android:layout_width="match_parent"
android:layout_height="match_parent"
style="@style/PageContent">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.cyanogenmod.setupwizard.ui.LocalePicker
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"/>
<include layout="@layout/logo_header" />
</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
limitations under the License.
-->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<include layout="@layout/header" />
<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:paddingTop="@dimen/content_margin_top"
android:paddingLeft="@dimen/content_margin_left"
android:paddingRight="@dimen/content_margin_right"
android:text="@string/sim_missing_summary" />
<FrameLayout android:id="@+id/page"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:src="@drawable/sim_back"/>
<ScrollView android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<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.
-->
<resources>
<dimen name="header_height">@dimen/page_title_height</dimen>
</resources>

View File

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

View File

@ -15,12 +15,13 @@
limitations under the License.
-->
<resources>
<dimen name="logo_header_height">290dp</dimen>
<dimen name="logo_header_height">220dp</dimen>
<dimen name="header_height">220dp</dimen>
<dimen name="page_title_height">56dp</dimen>
<dimen name="header_title_margin_left">26dp</dimen>
<dimen name="header_logo_margin_left">25dp</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_left">26dp</dimen>
<dimen name="content_margin_right">14dp</dimen>
@ -31,4 +32,6 @@
<dimen name="location_text_margin_right">30dp</dimen>
<dimen name="data_switch_margin_right">30dp</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>

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="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_gps">Improve location accuracy 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_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"><b>Improve location accuracy</b> by allowing apps to use the GPS on your phone.</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_no_service">No service</string>

View File

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

View File

@ -18,7 +18,6 @@ package com.cyanogenmod.setupwizard.setup;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
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() {
while (mCurrentPageIndex < mPageList.size()) {
mCurrentPageIndex++;

View File

@ -17,8 +17,6 @@
package com.cyanogenmod.setupwizard.setup;
import android.accounts.AccountManager;
import android.accounts.AccountManagerCallback;
import android.accounts.AccountManagerFuture;
import android.app.Activity;
import android.app.Fragment;
import android.content.Context;
@ -137,8 +135,6 @@ public class CyanogenServicesPage extends SetupPage {
private CheckBox mNavKeys;
private CheckBox mSecureSms;
private Runnable mDeferredAction;
private Handler mHandler;
@ -250,23 +246,10 @@ public class CyanogenServicesPage extends SetupPage {
return R.layout.setup_cyanogen_services;
}
@Override
protected int getHeaderLayoutResource() {
return R.layout.header_condensed;
}
@Override
public void onResume() {
super.onResume();
updateDisableNavkeysOption();
runDeferredAction();
}
private void runDeferredAction() {
if (mDeferredAction != null) {
mDeferredAction.run();
mDeferredAction = null;
}
}
private void updateDisableNavkeysOption() {
@ -279,28 +262,9 @@ public class CyanogenServicesPage extends SetupPage {
private void launchCyanogenAccountSetup(final Activity activity) {
Bundle bundle = new Bundle();
bundle.putBoolean(SetupWizardApp.EXTRA_FIRST_RUN, true);
AccountManager
.get(activity).addAccount(SetupWizardApp.ACCOUNT_TYPE_CYANOGEN, null, null, bundle,
activity, new AccountManagerCallback<Bundle>() {
@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);
AccountManager.get(activity)
.addAccount(SetupWizardApp.ACCOUNT_TYPE_CYANOGEN, null, null, bundle,
activity, null, null);
}
}

View File

@ -19,14 +19,20 @@ package com.cyanogenmod.setupwizard.setup;
import com.cyanogenmod.setupwizard.R;
import com.cyanogenmod.setupwizard.ui.SetupPageFragment;
import android.animation.Animator;
import android.app.Fragment;
import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.view.ViewAnimationUtils;
public class FinishPage extends SetupPage {
public static final String TAG = "FinishPage";
private FinishFragment mFinishFragment;
public FinishPage(Context context, SetupDataCallbacks callbacks) {
super(context, callbacks);
}
@ -36,9 +42,9 @@ public class FinishPage extends SetupPage {
Bundle args = new Bundle();
args.putString(SetupPage.KEY_PAGE_ARGUMENT, getKey());
FinishFragment fragment = new FinishFragment();
fragment.setArguments(args);
return fragment;
mFinishFragment = new FinishFragment();
mFinishFragment.setArguments(args);
return mFinishFragment;
}
@Override
@ -53,7 +59,7 @@ public class FinishPage extends SetupPage {
@Override
public boolean doNextAction() {
getCallbacks().onFinish();
mFinishFragment.animateOut(getCallbacks());
return true;
}
@ -69,18 +75,58 @@ public class FinishPage extends SetupPage {
public static class FinishFragment extends SetupPageFragment {
private View mReveal;
private Handler mHandler;
@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
protected int getLayoutResource() {
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;
}
@Override
protected int getHeaderLayoutResource() {
return R.layout.header_condensed;
}
@Override
public void onResume() {
super.onResume();

View File

@ -16,9 +16,6 @@
package com.cyanogenmod.setupwizard.setup;
import android.os.Bundle;
import android.view.LayoutInflater;
public interface SetupDataCallbacks {
void onNextPage();
void onPreviousPage();
@ -27,5 +24,4 @@ public interface SetupDataCallbacks {
void onFinish();
Page getPage(String 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.Fragment;
import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.transition.Slide;
import android.transition.Transition;
import android.view.Gravity;
public abstract class SetupPage implements Page {
@ -71,14 +73,19 @@ public abstract class SetupPage implements Page {
public void doLoadAction(Activity context, int action) {
if (context == null || context.isFinishing()) { return; }
final FragmentManager fragmentManager = context.getFragmentManager();
Fragment fragment = getFragment();
if (action == Page.ACTION_NEXT) {
FragmentTransaction transaction = fragmentManager.beginTransaction();
transaction.replace(R.id.content, getFragment(), getKey());
transaction.commit();
Transition t = new Slide(Gravity.RIGHT);
fragment.setEnterTransition(t);
fragmentManager.beginTransaction()
.replace(R.id.content,fragment, getKey())
.commit();
} else {
FragmentTransaction transaction = fragmentManager.beginTransaction();
transaction.replace(R.id.content, getFragment(), getKey());
transaction.commit();
Transition t = new Slide(Gravity.LEFT);
fragment.setEnterTransition(t);
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
protected void initializePage() {
mLanguagePicker = (LocalePicker) mRootView.findViewById(R.id.locale_list);
@ -152,10 +158,6 @@ public class WelcomePage extends SetupPage {
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);
final int defSelectionDividerHeight = (int) TypedValue.applyDimension(
TypedValue.COMPLEX_UNIT_DIP, UNSCALED_DEFAULT_SELECTION_DIVIDER_HEIGHT,
getResources().getDisplayMetrics());
mSelectionDividerHeight = attributesArray.getDimensionPixelSize(
R.styleable.NumberPicker_selectionDividerHeight, defSelectionDividerHeight);
mSelectionDividerHeight = UNSCALED_DEFAULT_SELECTION_DIVIDER_HEIGHT;
final int defSelectionDividerDistance = (int) TypedValue.applyDimension(
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.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.cyanogenmod.setupwizard.R;
import com.cyanogenmod.setupwizard.setup.Page;
@ -33,6 +34,8 @@ public abstract class SetupPageFragment extends Fragment {
protected String mKey;
protected Page mPage;
protected View mRootView;
protected TextView mTitleView;
protected ViewGroup mHeaderView;
@Override
public void onCreate(Bundle savedInstanceState) {
@ -48,7 +51,9 @@ public abstract class SetupPageFragment extends Fragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
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;
}
@ -56,9 +61,12 @@ public abstract class SetupPageFragment extends Fragment {
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
mPage = mCallbacks.getPage(mKey);
if (mTitleView != null) {
mTitleView.setText(mPage.getTitleResId());
}
initializePage();
mCallbacks.onPageLoaded(mPage);
getActivity().getWindow().setStatusBarColor(getResources().getColor(R.color.primary));
getActivity().getWindow().setStatusBarColor(getResources().getColor(R.color.status_bar));
}
@Override
@ -76,10 +84,6 @@ public abstract class SetupPageFragment extends Fragment {
mCallbacks = null;
}
protected int getHeaderLayoutResource() {
return R.layout.header;
}
protected abstract void initializePage();
protected abstract int getLayoutResource();

View File

@ -19,7 +19,9 @@ package com.cyanogenmod.setupwizard.ui;
import android.app.Activity;
import android.app.AppGlobals;
import android.content.Intent;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.drawable.GradientDrawable;
import android.os.Bundle;
import android.provider.Settings;
import android.util.Log;
@ -45,11 +47,8 @@ public class SetupWizardActivity extends Activity implements SetupDataCallbacks
private static final String TAG = SetupWizardActivity.class.getSimpleName();
private View mRootView;
private View mPageView;
private Button mNextButton;
private Button mPrevButton;
private TextView mTitleView;
private ViewGroup mHeaderView;
private AbstractSetupData mSetupData;
@ -57,13 +56,11 @@ public class SetupWizardActivity extends Activity implements SetupDataCallbacks
super.onCreate(savedInstanceState);
setContentView(R.layout.setup_main);
mRootView = findViewById(R.id.root);
mPageView = findViewById(R.id.page);
((SetupWizardApp)getApplicationContext()).disableStatusBar();
mSetupData = (AbstractSetupData)getLastNonConfigurationInstance();
if (mSetupData == null) {
mSetupData = new CMSetupWizardData(this);
}
mHeaderView = (ViewGroup)findViewById(R.id.header);
mNextButton = (Button) findViewById(R.id.next_button);
mPrevButton = (Button) findViewById(R.id.prev_button);
mSetupData.registerListener(this);
@ -118,24 +115,9 @@ public class SetupWizardActivity extends Activity implements SetupDataCallbacks
@Override
public void onBackPressed() {
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());
}
if (!mSetupData.isFirstPage()) {
mSetupData.onPreviousPage();
}
}
@Override
@ -152,6 +134,14 @@ public class SetupWizardActivity extends Activity implements SetupDataCallbacks
@Override
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();
}
@ -179,18 +169,12 @@ public class SetupWizardActivity extends Activity implements SetupDataCallbacks
if (mSetupData.isLastPage()) {
mPrevButton.setVisibility(View.INVISIBLE);
mRootView.setBackgroundColor(resources.getColor(R.color.primary));
mPageView.setBackgroundColor(resources.getColor(R.color.primary));
mNextButton.setCompoundDrawablesWithIntrinsicBounds(null, null,
getDrawable(R.drawable.ic_chevron_right_wht), null);
mNextButton.setTextColor(resources.getColor(R.color.white));
} else {
mPrevButton.setVisibility(View.VISIBLE);
mPageView.setBackgroundColor(resources.getColor(R.color.page_background));
if (mSetupData.isFirstPage()) {
mRootView.setBackgroundColor(resources.getColor(R.color.page_background));
} else {
mRootView.setBackgroundColor(resources.getColor(R.color.window_background));
}
mRootView.setBackgroundColor(resources.getColor(R.color.window_background));
mNextButton.setCompoundDrawablesWithIntrinsicBounds(null, null,
getDrawable(R.drawable.ic_chevron_right_dark), null);
mNextButton.setTextColor(resources.getColor(R.color.primary_text));