SUW: Redesign Welcome page based on Pixel
Change-Id: I2080c4d22fd5d0af1b1060f86ce1be0b7469757c
diff --git a/res/drawable/logo.xml b/res/drawable/logo.xml
index 07722ba..ffaf10a 100644
--- a/res/drawable/logo.xml
+++ b/res/drawable/logo.xml
@@ -16,35 +16,12 @@
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="512dp"
- android:height="320dp"
+ android:height="260dp"
android:viewportWidth="512"
- android:viewportHeight="320">
+ android:viewportHeight="260">
<path
android:fillColor="@color/lineage_accent"
- android:pathData="M157.89,271.64a1.83,1.83,0,0,1-1.89-1.89V248.42h4.65v19.32H171v3.9Z" />
- <path
- android:fillColor="@color/lineage_accent"
- android:pathData="M185,271.64V248.42h4.68v23.22Z" />
- <path
- android:fillColor="@color/lineage_accent"
- android:pathData="M221.17,248.42h4.26v22a1.23,1.23,0,0,1-.67,1.09,3.17,3.17,0,0,1-1.67 .41
-,4,4,0,0,1-1.71-.29,3.11,3.11,0,0,1-1.12-1L210,256v15.61h-4.32v-21.5a1.56,1.56,0,0,1,.68-1.4,3.18,3.18,0,0,1,1.79-.46,3.59,3.59,0,0,1,1.9
-.39 ,5.91,5.91,0,0,1,1.41,1.56l9.72,13.59Z" />
- <path
- android:fillColor="@color/lineage_accent"
- android:pathData="M256.9,252.36H246.2v5.5h9.63v3.93H246.2v5.89H256.6v4H241.51V250.31a1.74,1.74,0,0,1,.59-1.37,2,2,0,0,1,1.4-.52h13.4Z" />
- <path
- android:fillColor="@color/lineage_accent"
- android:pathData="M286.38,271.64l-2-5.76h-8.49l-2,5.76h-4.85l7.87-21.5q.68-1.85,3.15-1.85t3.19,1.89l7.87,21.46ZM277.27,262h5.82l-2.93-8.62Z" />
- <path
- android:fillColor="@color/lineage_accent"
- android:pathData="M314.33,272a11,11,0,0,1-8.36-3.19,11.93,11.93,0,0,1-3.06-8.62,12.12,12.12,0,0,1,3.25-8.89,11.56,11.56,0,0,1,8.62-3.3,11.44,11.44,0,0,1,6,1.5,9,9,0,0,1,3.63,3.93l-3.74,2q-1.69-3.41-6-3.41a6.53,6.53,0,0,0-5.14,2.16,8.58,8.58,0,0,0-1.92,5.9,8.67,8.67,0,0,0,1.79,5.8,6.11,6.11,0,0,0,4.91,2.1,6.74,6.74,0,0,0,4.6-1.58,5.26,5.26,0,0,0,1.87-4h-5.89v-3.67h10.5v2.57a10.19,10.19,0,0,1-3.12,7.72A11.12,11.12,0,0,1,314.33,272Z" />
- <path
- android:fillColor="@color/lineage_accent"
- android:pathData="M356,252.36H345.3v5.5h9.63v3.93H345.3v5.89h10.41v4H340.62V250.31a1.74,1.74,0,0,1,.59-1.37,2,2,0,0,1,1.4-.52H356Z" />
- <path
- android:fillColor="@color/lineage_accent"
android:pathData="M416,128a39.92,39.92,0,0,0-31.11,14.87l-1.5-.6A294.79,294.79,0,0,0,336,128.14s0-.09,0-.14a80,80,0,1,0-160,0s0,.09,0,.13l-1.72
.38 a293.48,293.48,0,0,0-45.67,13.76l-1.5 .6
a40,40,0,1,0,7.39,14.28h0a277.33,277.33,0,0,1,43.1-13,80,80,0,0,0,156.73,0,277.3,277.3,0,0,1,43.11,13h0A40,40,0,1,0,416,128ZM96,192a24,24,0,1,1,24-24A24,24,0,0,1,96,192Zm160,0a64,64,0,1,1,64-64A64.07,64.07,0,0,1,256,192Zm160,0a24,24,0,1,1,24-24A24,24,0,0,1,416,192ZM288,128a32,32,0,1,1-32-32A32,32,0,0,1,288,128Z" />
diff --git a/res/layout-large-notouch/welcome_activity.xml b/res/layout-large-notouch/welcome_activity.xml
index 3341191..7d0e210 100644
--- a/res/layout-large-notouch/welcome_activity.xml
+++ b/res/layout-large-notouch/welcome_activity.xml
@@ -34,20 +34,29 @@
android:id="@+id/brand_logo"
android:layout_width="wrap_content"
android:layout_height="0dp"
- android:layout_weight="80"
+ android:layout_weight="65"
android:layout_gravity="center"
android:src="@drawable/logo"
android:adjustViewBounds="true"
android:scaleType="fitCenter"
android:gravity="center"
- android:padding="@dimen/content_margin_left" />
+ android:paddingTop="@dimen/content_margin_left"
+ android:paddingRight="@dimen/content_margin_left"
+ android:paddingLeft="@dimen/content_margin_left"
+ android:paddingBottom="0dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
- android:layout_weight="20"
+ android:layout_weight="35"
android:gravity="center_vertical"
android:orientation="vertical">
+ <TextView
+ style="@style/WelcomeTitle"
+ android:id="@+id/welcome_title"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:hyphenationFrequency="none" />
<Button
android:id="@+id/start"
android:layout_width="wrap_content"
diff --git a/res/layout/welcome_activity.xml b/res/layout/welcome_activity.xml
index 205ec0d..798745e 100644
--- a/res/layout/welcome_activity.xml
+++ b/res/layout/welcome_activity.xml
@@ -23,60 +23,92 @@
android:layout_height="match_parent">
<LinearLayout
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
android:orientation="vertical"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- style="@style/SudContentFrame">
+ android:paddingTop="@dimen/welcome_content_container_padding_top">
+
+ <ImageView
+ android:id="@+id/brand_logo"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:adjustViewBounds="true"
+ android:gravity="center"
+ android:scaleType="centerCrop"
+ android:src="@drawable/logo" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_gravity="bottom"
+ android:orientation="vertical">
<LinearLayout
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="1"
- android:gravity="center_vertical"
- android:orientation="vertical">
+ style="@style/SudContentFrame"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_gravity="bottom"
+ android:orientation="vertical"
+ android:paddingStart="@dimen/welcome_content_container_padding_start"
+ android:paddingEnd="@dimen/welcome_content_container_padding_end"
+ android:paddingBottom="@dimen/welcome_content_container_padding_bottom">
- <ImageView
- android:id="@+id/brand_logo"
- android:layout_width="match_parent"
+ <TextView
+ style="@style/WelcomeTitle"
+ android:id="@+id/welcome_title"
+ android:layout_width="fill_parent"
android:layout_height="wrap_content"
- android:src="@drawable/logo"
- android:adjustViewBounds="true"
- android:scaleType="fitCenter"
- android:gravity="center"
- android:padding="@dimen/content_margin_left" />
+ android:hyphenationFrequency="none"
+ android:paddingBottom="@dimen/welcome_content_container_padding_bottom" />
- <Button
- android:id="@+id/start"
- android:layout_width="wrap_content"
+ <LinearLayout
+ android:layout_width="fill_parent"
android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:text="@string/start"
- style="@style/SudGlifButton.Primary" />
+ android:animateLayoutChanges="true"
+ android:focusableInTouchMode="true"
+ android:importantForAccessibility="no"
+ android:orientation="vertical">
+ <Button
+ android:id="@+id/launch_accessibility"
+ style="@style/SudGlifButton.Secondary"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:layout_gravity="center_vertical"
+ android:drawableStart="@drawable/ic_eye"
+ android:gravity="start|center"
+ android:drawablePadding="@dimen/welcome_content_container_padding_end"
+ android:textSize="@dimen/welcome_accessibility_text_size"
+ android:textColor="?android:textColorPrimary"
+ android:text="@string/accessibility_settings" />
+ </LinearLayout>
</LinearLayout>
<LinearLayout
- android:layout_width="match_parent"
+ style="@style/SudGlifButtonBar.Stackable"
+ android:layout_width="fill_parent"
android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:gravity="center">
+ android:layout_gravity="bottom">
<Button
android:id="@+id/emerg_dialer"
+ style="@style/SudGlifButton.Secondary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:drawableTop="@drawable/ic_dialer"
- android:text="@string/emergency_call"
- style="@style/SudGlifButton.Secondary" />
+ android:text="@string/emergency_call" />
+
+ <Space
+ android:layout_width="0.0dip"
+ android:layout_height="0.0dip"
+ android:layout_weight="1.0" />
<Button
- android:id="@+id/launch_accessibility"
+ android:id="@id/start"
+ style="@style/SudGlifButton.Primary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:drawableTop="@drawable/ic_eye"
- android:text="@string/accessibility_settings"
- style="@style/SudGlifButton.Secondary" />
-
+ android:text="@string/start" />
</LinearLayout>
</LinearLayout>
</com.google.android.setupdesign.GlifLayout>
diff --git a/res/values-large-notouch/dimens.xml b/res/values-large-notouch/dimens.xml
index 5757bf7..1642403 100644
--- a/res/values-large-notouch/dimens.xml
+++ b/res/values-large-notouch/dimens.xml
@@ -16,4 +16,6 @@
-->
<resources>
<dimen name="base_margin_top">56dp</dimen>
+ <dimen name="content_margin_left">16dp</dimen>
+ <dimen name="welcome_title_padding_bottom">30dp</dimen>
</resources>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 43b5ad5..882885f 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -37,4 +37,14 @@
<dimen name="setup_line_spacing">3sp</dimen>
<dimen name="min_locale_picker_height">100dp</dimen>
<dimen name="base_margin_top">0dp</dimen>
+
+ <dimen name="welcome_content_container_padding_top">100dp</dimen>
+ <dimen name="welcome_content_container_padding_bottom">30dp</dimen>
+ <dimen name="welcome_content_container_padding_end">24dp</dimen>
+ <dimen name="welcome_content_container_padding_start">40dp</dimen>
+ <dimen name="welcome_title_text_size">56sp</dimen>
+ <dimen name="welcome_title_padding_bottom">16dp</dimen>
+ <dimen name="welcome_title_line_height">64dp</dimen>
+ <dimen name="welcome_accessibility_text_size">20sp</dimen>
+
</resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 02a74c1..cff3db5 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -33,6 +33,7 @@
<string name="setup_complete">Setup is complete</string>
<string name="setup_welcome">Welcome</string>
+ <string name="setup_welcome_message">Welcome to <xliff:g id="name" example="LineageOS">%1$s</xliff:g></string>
<string name="setup_locale">Language</string>
<string name="setup_wifi">Select Wi-Fi</string>
<string name="setup_sim_missing">SIM card missing</string>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 7071252..5e7eda7 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -47,4 +47,12 @@
</style>
<style name="NoDisplay" parent="@android:style/Theme.NoDisplay" />
+
+ <style name="WelcomeTitle">
+ <item name="android:textSize">@dimen/welcome_title_text_size</item>
+ <item name="android:textColor">?android:textColorPrimary</item>
+ <item name="android:gravity">start</item>
+ <item name="android:paddingBottom">@dimen/welcome_title_padding_bottom</item>
+ <item name="android:lineHeight">@dimen/welcome_title_line_height</item>
+ </style>
</resources>
diff --git a/src/org/lineageos/setupwizard/WelcomeActivity.java b/src/org/lineageos/setupwizard/WelcomeActivity.java
index ce0de39..b115f81 100644
--- a/src/org/lineageos/setupwizard/WelcomeActivity.java
+++ b/src/org/lineageos/setupwizard/WelcomeActivity.java
@@ -21,6 +21,7 @@
import android.view.MotionEvent;
import android.view.View;
import android.widget.Button;
+import android.widget.TextView;
import com.google.android.setupcompat.template.FooterButtonStyleUtils;
import com.google.android.setupcompat.util.SystemBarHelper;
@@ -47,6 +48,10 @@
FooterButtonStyleUtils.applyPrimaryButtonPartnerResource(this, startButton, true);
FooterButtonStyleUtils.applySecondaryButtonPartnerResource(this, emergButton, true);
+
+ TextView welcomeTitle = findViewById(R.id.welcome_title);
+ welcomeTitle.setText(getString(R.string.setup_welcome_message,
+ getString(R.string.os_name)));
}
@Override