Update gesture tutorial colors
- Updated all redesigned gesture nav menu and tutorial colors to dynamic color spec
Flag: ENABLE_NEW_GESTURE_NAV_TUTORIAL
Bug: 281764891
Bug: 279823249
Test: launched tutorial menu and tutorial steps
Change-Id: I03532b80c6e14867c1374bbdf9f984c1cece9809
diff --git a/quickstep/res/drawable-sw600dp-land/gesture_tutorial_back_step_shape.xml b/quickstep/res/drawable-sw600dp-land/gesture_tutorial_back_step_shape.xml
index 0f2650b..a07aeaa 100644
--- a/quickstep/res/drawable-sw600dp-land/gesture_tutorial_back_step_shape.xml
+++ b/quickstep/res/drawable-sw600dp-land/gesture_tutorial_back_step_shape.xml
@@ -19,5 +19,5 @@
android:viewportHeight="208">
<path
android:pathData="M24.53,169.2L32.09,165.56C77.7,143.55 77.7,64.45 32.09,42.35L24.53,38.71C14.55,33.95 6.06,25.56 0,14.92V193.08C6.06,182.44 14.55,174.05 24.53,169.2Z"
- android:fillColor="#217500"/>
+ android:fillColor="?attr/onSurfaceBack"/>
</vector>
diff --git a/quickstep/res/drawable-sw600dp-land/gesture_tutorial_home_step_shape.xml b/quickstep/res/drawable-sw600dp-land/gesture_tutorial_home_step_shape.xml
index fd14d34..6839718 100644
--- a/quickstep/res/drawable-sw600dp-land/gesture_tutorial_home_step_shape.xml
+++ b/quickstep/res/drawable-sw600dp-land/gesture_tutorial_home_step_shape.xml
@@ -19,5 +19,5 @@
android:viewportHeight="67">
<path
android:pathData="M180.9,0.6H51.1C22.9,0.6 0,23.4 0,51.7V67.6H232V51.7C232,23.4 209.1,0.6 180.9,0.6Z"
- android:fillColor="#4B67AE"/>
+ android:fillColor="?attr/onSurfaceHome"/>
</vector>
diff --git a/quickstep/res/drawable-sw600dp-land/gesture_tutorial_overview_step_shape.xml b/quickstep/res/drawable-sw600dp-land/gesture_tutorial_overview_step_shape.xml
index f271c47..4111718 100644
--- a/quickstep/res/drawable-sw600dp-land/gesture_tutorial_overview_step_shape.xml
+++ b/quickstep/res/drawable-sw600dp-land/gesture_tutorial_overview_step_shape.xml
@@ -19,5 +19,5 @@
android:viewportHeight="94">
<path
android:pathData="M185.56,76.95C184.79,75.3 184.3,73.56 184.21,71.81L182.85,55.81C182.46,51.34 180.13,47.27 176.45,44.65L163.25,35.44C161.8,34.37 160.54,33.11 159.47,31.65L150.16,18.46C147.54,14.77 143.47,12.45 139,12.06L123,10.6C121.25,10.41 119.51,10.02 117.86,9.24L103.31,2.45C101.27,1.49 99.04,1 96.91,1C94.77,1 92.54,1.49 90.5,2.45L75.95,9.24C74.31,10.02 72.56,10.51 70.81,10.6L54.81,11.96C50.35,12.35 46.27,14.68 43.65,18.36L34.44,31.56C33.37,33.01 32.11,34.27 30.66,35.34L17.27,44.65C13.58,47.27 11.26,51.34 10.87,55.81L9.41,71.81C9.22,73.56 8.83,75.3 8.05,76.95L1.26,91.5C0.78,92.67 0.39,93.83 0.1,94.99H193.52C193.32,93.83 192.94,92.57 192.35,91.5L185.56,76.95Z"
- android:fillColor="#7E44AD"/>
+ android:fillColor="?attr/onSurfaceOverview"/>
</vector>
diff --git a/quickstep/res/drawable-sw720dp-land/gesture_tutorial_back_step_shape.xml b/quickstep/res/drawable-sw720dp-land/gesture_tutorial_back_step_shape.xml
index 02f6ff9..e20458e 100644
--- a/quickstep/res/drawable-sw720dp-land/gesture_tutorial_back_step_shape.xml
+++ b/quickstep/res/drawable-sw720dp-land/gesture_tutorial_back_step_shape.xml
@@ -19,5 +19,5 @@
android:viewportHeight="303">
<path
android:pathData="M35.65,245.9L46.63,240.61C112.92,208.62 112.92,93.67 46.63,61.54L35.65,56.26C21.15,49.34 8.81,37.14 0,21.69V280.6C8.81,265.15 21.15,252.95 35.65,245.9Z"
- android:fillColor="#217500"/>
+ android:fillColor="?attr/onSurfaceBack"/>
</vector>
diff --git a/quickstep/res/drawable-sw720dp-land/gesture_tutorial_home_step_shape.xml b/quickstep/res/drawable-sw720dp-land/gesture_tutorial_home_step_shape.xml
index 3e71a3d..0c050ca 100644
--- a/quickstep/res/drawable-sw720dp-land/gesture_tutorial_home_step_shape.xml
+++ b/quickstep/res/drawable-sw720dp-land/gesture_tutorial_home_step_shape.xml
@@ -19,5 +19,5 @@
android:viewportHeight="73">
<path
android:pathData="M282.3,0H79.7C38,0 3.7,32.1 0.3,73H361.7C358.3,32.1 324,0 282.3,0Z"
- android:fillColor="#4B67AE"/>
+ android:fillColor="?attr/onSurfaceHome"/>
</vector>
diff --git a/quickstep/res/drawable-sw720dp-land/gesture_tutorial_overview_step_shape.xml b/quickstep/res/drawable-sw720dp-land/gesture_tutorial_overview_step_shape.xml
index 2f11192..d012897 100644
--- a/quickstep/res/drawable-sw720dp-land/gesture_tutorial_overview_step_shape.xml
+++ b/quickstep/res/drawable-sw720dp-land/gesture_tutorial_overview_step_shape.xml
@@ -19,5 +19,5 @@
android:viewportHeight="144">
<path
android:pathData="M284.38,116.48C283.19,113.95 282.45,111.28 282.3,108.61L280.22,84.1C279.63,77.27 276.06,71.03 270.42,67.03L250.22,52.92C247.99,51.28 246.06,49.35 244.43,47.13L230.18,26.93C226.16,21.29 219.93,17.72 213.1,17.13L188.6,14.9C185.92,14.6 183.25,14.01 180.72,12.82L158.45,2.43C155.33,0.94 151.91,0.2 148.65,0.2C145.38,0.2 141.97,0.94 138.85,2.43L116.57,12.82C114.05,14.01 111.38,14.75 108.7,14.9L84.2,16.98C77.37,17.57 71.13,21.14 67.12,26.78L53.01,46.98C51.38,49.21 49.45,51.14 47.22,52.77L26.73,67.03C21.09,71.03 17.52,77.27 16.93,84.1L14.7,108.61C14.4,111.28 13.81,113.95 12.62,116.48L2.23,138.75C1.48,140.53 0.89,142.32 0.45,144.1H296.55C296.26,142.32 295.66,140.38 294.77,138.75L284.38,116.48Z"
- android:fillColor="#7E44AD"/>
+ android:fillColor="?attr/onSurfaceOverview"/>
</vector>
diff --git a/quickstep/res/drawable/gesture_tutorial_action_button_background.xml b/quickstep/res/drawable/gesture_tutorial_action_button_background.xml
index 98dc1a5..e5f1a56 100644
--- a/quickstep/res/drawable/gesture_tutorial_action_button_background.xml
+++ b/quickstep/res/drawable/gesture_tutorial_action_button_background.xml
@@ -13,7 +13,8 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
<item>
<shape
android:id="@android:id/mask"
@@ -25,7 +26,7 @@
<shape
android:shape="rectangle">
<corners android:radius="50dp"/>
- <solid android:color="?android:attr/colorAccent"/>
+ <solid android:color="?androidprv:attr/materialColorPrimary"/>
</shape>
</item>
</layer-list>
\ No newline at end of file
diff --git a/quickstep/res/drawable/gesture_tutorial_back_step_shape.xml b/quickstep/res/drawable/gesture_tutorial_back_step_shape.xml
index 5f951e4..9389340 100644
--- a/quickstep/res/drawable/gesture_tutorial_back_step_shape.xml
+++ b/quickstep/res/drawable/gesture_tutorial_back_step_shape.xml
@@ -19,5 +19,5 @@
android:viewportHeight="208">
<path
android:pathData="M23.53,169.2L31.09,165.56C76.7,143.55 76.7,64.45 31.09,42.35L23.53,38.71C13.55,33.95 5.06,25.56 -1,14.92V193.08C5.06,182.44 13.55,174.05 23.53,169.2Z"
- android:fillColor="#217500"/>
+ android:fillColor="?attr/onSurfaceBack"/>
</vector>
diff --git a/quickstep/res/drawable/gesture_tutorial_home_step_shape.xml b/quickstep/res/drawable/gesture_tutorial_home_step_shape.xml
index 698cba1..f04a38e 100644
--- a/quickstep/res/drawable/gesture_tutorial_home_step_shape.xml
+++ b/quickstep/res/drawable/gesture_tutorial_home_step_shape.xml
@@ -19,5 +19,5 @@
android:viewportHeight="66">
<path
android:pathData="M283.8,0H80.2C40.7,0 8,28.5 1.3,66H362.8C356,28.5 323.3,0 283.8,0Z"
- android:fillColor="#4B67AE"/>
+ android:fillColor="?attr/onSurfaceHome"/>
</vector>
diff --git a/quickstep/res/drawable/gesture_tutorial_menu_button_background.xml b/quickstep/res/drawable/gesture_tutorial_menu_back_button_background.xml
similarity index 94%
rename from quickstep/res/drawable/gesture_tutorial_menu_button_background.xml
rename to quickstep/res/drawable/gesture_tutorial_menu_back_button_background.xml
index 1ab776b..f83ee7f 100644
--- a/quickstep/res/drawable/gesture_tutorial_menu_button_background.xml
+++ b/quickstep/res/drawable/gesture_tutorial_menu_back_button_background.xml
@@ -15,5 +15,6 @@
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
+ <solid android:color="?attr/surfaceBack" />
<corners android:radius="@dimen/gesture_tutorial_menu_button_radius" />
</shape>
diff --git a/quickstep/res/drawable/gesture_tutorial_menu_button_background.xml b/quickstep/res/drawable/gesture_tutorial_menu_home_button_background.xml
similarity index 94%
copy from quickstep/res/drawable/gesture_tutorial_menu_button_background.xml
copy to quickstep/res/drawable/gesture_tutorial_menu_home_button_background.xml
index 1ab776b..a0833dd 100644
--- a/quickstep/res/drawable/gesture_tutorial_menu_button_background.xml
+++ b/quickstep/res/drawable/gesture_tutorial_menu_home_button_background.xml
@@ -15,5 +15,6 @@
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
+ <solid android:color="?attr/surfaceHome" />
<corners android:radius="@dimen/gesture_tutorial_menu_button_radius" />
</shape>
diff --git a/quickstep/res/drawable/gesture_tutorial_menu_button_background.xml b/quickstep/res/drawable/gesture_tutorial_menu_overview_button_background.xml
similarity index 93%
copy from quickstep/res/drawable/gesture_tutorial_menu_button_background.xml
copy to quickstep/res/drawable/gesture_tutorial_menu_overview_button_background.xml
index 1ab776b..3d37f05 100644
--- a/quickstep/res/drawable/gesture_tutorial_menu_button_background.xml
+++ b/quickstep/res/drawable/gesture_tutorial_menu_overview_button_background.xml
@@ -15,5 +15,6 @@
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
+ <solid android:color="?attr/surfaceOverview" />
<corners android:radius="@dimen/gesture_tutorial_menu_button_radius" />
</shape>
diff --git a/quickstep/res/drawable/gesture_tutorial_overview_step_shape.xml b/quickstep/res/drawable/gesture_tutorial_overview_step_shape.xml
index cc2c491..97a129d 100644
--- a/quickstep/res/drawable/gesture_tutorial_overview_step_shape.xml
+++ b/quickstep/res/drawable/gesture_tutorial_overview_step_shape.xml
@@ -19,5 +19,5 @@
android:viewportHeight="76">
<path
android:pathData="M188.6,56.5C188.2,51.9 185.8,47.7 182,45L168.4,35.5C166.9,34.4 165.6,33.1 164.5,31.6L155,18C152.3,14.2 148.1,11.8 143.5,11.4L127,9.9C125.2,9.7 123.4,9.3 121.7,8.5L106.7,1.5C104.6,0.5 102.3,0 100.1,0C97.8,0 95.6,0.5 93.5,1.5L78.5,8.5C76.8,9.3 75,9.8 73.2,9.9L56.7,11.3C52.1,11.7 47.9,14.1 45.2,17.9L35.7,31.5C34.6,33 33.3,34.3 31.8,35.4L18,45C14.2,47.7 11.8,51.9 11.4,56.5L9.9,73C9.8,74 9.6,75 9.3,76H190.6C190.3,75 190.1,74 190,73L188.6,56.5Z"
- android:fillColor="#7E44AD"/>
+ android:fillColor="?attr/onSurfaceOverview"/>
</vector>
diff --git a/quickstep/res/drawable/hotseat_icon_home.xml b/quickstep/res/drawable/hotseat_icon_home.xml
index d59dd4a..9ef4863 100644
--- a/quickstep/res/drawable/hotseat_icon_home.xml
+++ b/quickstep/res/drawable/hotseat_icon_home.xml
@@ -16,6 +16,6 @@
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
- <solid android:color="@color/gesture_home_tutorial_background" />
+ <solid android:color="?attr/surfaceHome" />
<corners android:radius="@dimen/gesture_tutorial_hotseat_icon_corner_radius" />
</shape>
\ No newline at end of file
diff --git a/quickstep/res/drawable/redesigned_default_sandbox_app_icon.xml b/quickstep/res/drawable/redesigned_default_sandbox_app_icon.xml
index cb94d9a..2ab6749 100644
--- a/quickstep/res/drawable/redesigned_default_sandbox_app_icon.xml
+++ b/quickstep/res/drawable/redesigned_default_sandbox_app_icon.xml
@@ -13,5 +13,5 @@
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
- <solid android:color="@color/gesture_home_tutorial_background" />
+ <solid android:color="?attr/surfaceHome" />
</shape>
diff --git a/quickstep/res/drawable/gesture_tutorial_menu_button_background.xml b/quickstep/res/drawable/redesigned_top_task_view.xml
similarity index 80%
copy from quickstep/res/drawable/gesture_tutorial_menu_button_background.xml
copy to quickstep/res/drawable/redesigned_top_task_view.xml
index 1ab776b..2c136de 100644
--- a/quickstep/res/drawable/gesture_tutorial_menu_button_background.xml
+++ b/quickstep/res/drawable/redesigned_top_task_view.xml
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2023 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,5 +16,6 @@
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
- <corners android:radius="@dimen/gesture_tutorial_menu_button_radius" />
-</shape>
+ <solid android:color="?attr/surfaceContainer" />
+ <corners android:radius="@dimen/gesture_tutorial_small_task_view_corner_radius" />
+</shape>
\ No newline at end of file
diff --git a/quickstep/res/layout-sw600dp-land/gesture_tutorial_step_menu.xml b/quickstep/res/layout-sw600dp-land/gesture_tutorial_step_menu.xml
index d24219d..b13e8dc 100644
--- a/quickstep/res/layout-sw600dp-land/gesture_tutorial_step_menu.xml
+++ b/quickstep/res/layout-sw600dp-land/gesture_tutorial_step_menu.xml
@@ -15,13 +15,15 @@
-->
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:theme="@style/GestureTutorialActivity"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="@dimen/gesture_tutorial_menu_padding_top"
android:paddingBottom="@dimen/gesture_tutorial_menu_padding_bottom"
android:paddingHorizontal="@dimen/gesture_tutorial_menu_padding_horizontal"
- android:background="@color/gesture_tutorial_menu_background">
+ android:background="?androidprv:attr/materialColorSurfaceContainer">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/gesture_tutorial_menu_home_button"
@@ -29,9 +31,8 @@
android:layout_height="@dimen/gesture_tutorial_menu_button_height"
android:layout_marginEnd="@dimen/gesture_tutorial_menu_button_spacing"
android:layout_marginBottom="24dp"
- android:background="@drawable/gesture_tutorial_menu_button_background"
+ android:background="@drawable/gesture_tutorial_menu_home_button_background"
android:clipToOutline="true"
- android:backgroundTint="@color/gesture_home_tutorial_background"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/guideline"
@@ -50,7 +51,7 @@
app:layout_constraintEnd_toEndOf="parent"/>
<TextView
- style="@style/TextAppearance.GestureTutorial.MenuButton"
+ style="@style/TextAppearance.GestureTutorial.MenuButton.Home"
android:id="@+id/gesture_tutorial_menu_home_button_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -69,9 +70,8 @@
android:layout_height="@dimen/gesture_tutorial_menu_button_height"
android:layout_marginEnd="@dimen/gesture_tutorial_menu_button_spacing"
android:layout_marginBottom="24dp"
- android:background="@drawable/gesture_tutorial_menu_button_background"
+ android:background="@drawable/gesture_tutorial_menu_back_button_background"
android:clipToOutline="true"
- android:backgroundTint="@color/gesture_back_tutorial_exiting_app"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/guideline"
@@ -90,7 +90,7 @@
app:layout_constraintStart_toStartOf="parent"/>
<TextView
- style="@style/TextAppearance.GestureTutorial.MenuButton"
+ style="@style/TextAppearance.GestureTutorial.MenuButton.Back"
android:id="@+id/gesture_tutorial_menu_back_button_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -108,9 +108,8 @@
android:layout_width="0dp"
android:layout_height="@dimen/gesture_tutorial_menu_button_height"
android:layout_marginBottom="24dp"
- android:background="@drawable/gesture_tutorial_menu_button_background"
+ android:background="@drawable/gesture_tutorial_menu_overview_button_background"
android:clipToOutline="true"
- android:backgroundTint="@color/gesture_overview_tutorial_background"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/guideline"
@@ -129,7 +128,7 @@
app:layout_constraintEnd_toEndOf="parent"/>
<TextView
- style="@style/TextAppearance.GestureTutorial.MenuButton"
+ style="@style/TextAppearance.GestureTutorial.MenuButton.Overview"
android:id="@+id/gesture_tutorial_menu_overview_button_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
diff --git a/quickstep/res/layout/gesture_tutorial_mock_task_view.xml b/quickstep/res/layout/gesture_tutorial_mock_task_view.xml
index 609e5f8..047fdb1 100644
--- a/quickstep/res/layout/gesture_tutorial_mock_task_view.xml
+++ b/quickstep/res/layout/gesture_tutorial_mock_task_view.xml
@@ -13,8 +13,9 @@
-->
<View
xmlns:android="http://schemas.android.com/apk/res/android"
+ android:theme="@style/GestureTutorialActivity"
android:id="@+id/overview_gesture_tutorial_shape"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="20dp"
- android:background="@color/gesture_overview_tutorial_background" />
\ No newline at end of file
+ android:background="?attr/onSurfaceOverview" />
\ No newline at end of file
diff --git a/quickstep/res/layout/gesture_tutorial_step_menu.xml b/quickstep/res/layout/gesture_tutorial_step_menu.xml
index cf1e4d7..7a302f4 100644
--- a/quickstep/res/layout/gesture_tutorial_step_menu.xml
+++ b/quickstep/res/layout/gesture_tutorial_step_menu.xml
@@ -15,22 +15,23 @@
-->
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:theme="@style/GestureTutorialActivity"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="@dimen/gesture_tutorial_menu_padding_top"
android:paddingBottom="@dimen/gesture_tutorial_menu_padding_bottom"
android:paddingHorizontal="@dimen/gesture_tutorial_menu_padding_horizontal"
- android:background="@color/gesture_tutorial_menu_background"
+ android:background="?androidprv:attr/materialColorSurfaceContainer"
android:clipToPadding="false">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/gesture_tutorial_menu_home_button"
android:layout_width="match_parent"
android:layout_height="@dimen/gesture_tutorial_menu_button_height"
- android:background="@drawable/gesture_tutorial_menu_button_background"
+ android:background="@drawable/gesture_tutorial_menu_home_button_background"
android:clipToOutline="true"
- android:backgroundTint="@color/gesture_home_tutorial_background"
app:layout_constraintVertical_chainStyle="packed"
app:layout_constraintTop_toTopOf="parent"
@@ -50,7 +51,7 @@
app:layout_constraintEnd_toEndOf="parent"/>
<TextView
- style="@style/TextAppearance.GestureTutorial.MenuButton"
+ style="@style/TextAppearance.GestureTutorial.MenuButton.Home"
android:id="@+id/gesture_tutorial_menu_home_button_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -68,9 +69,8 @@
android:layout_width="match_parent"
android:layout_height="@dimen/gesture_tutorial_menu_button_height"
android:layout_marginTop="@dimen/gesture_tutorial_menu_button_spacing"
- android:background="@drawable/gesture_tutorial_menu_button_background"
+ android:background="@drawable/gesture_tutorial_menu_back_button_background"
android:clipToOutline="true"
- android:backgroundTint="@color/gesture_back_tutorial_exiting_app"
app:layout_constraintTop_toBottomOf="@id/gesture_tutorial_menu_home_button"
app:layout_constraintBottom_toTopOf="@id/gesture_tutorial_menu_overview_button"
@@ -89,7 +89,7 @@
app:layout_constraintStart_toStartOf="parent"/>
<TextView
- style="@style/TextAppearance.GestureTutorial.MenuButton"
+ style="@style/TextAppearance.GestureTutorial.MenuButton.Back"
android:id="@+id/gesture_tutorial_menu_back_button_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -107,9 +107,8 @@
android:layout_width="match_parent"
android:layout_height="@dimen/gesture_tutorial_menu_button_height"
android:layout_marginTop="@dimen/gesture_tutorial_menu_button_spacing"
- android:background="@drawable/gesture_tutorial_menu_button_background"
+ android:background="@drawable/gesture_tutorial_menu_overview_button_background"
android:clipToOutline="true"
- android:backgroundTint="@color/gesture_overview_tutorial_background"
app:layout_constraintTop_toBottomOf="@id/gesture_tutorial_menu_back_button"
app:layout_constraintBottom_toTopOf="@id/guideline"
@@ -128,7 +127,7 @@
app:layout_constraintEnd_toEndOf="parent"/>
<TextView
- style="@style/TextAppearance.GestureTutorial.MenuButton"
+ style="@style/TextAppearance.GestureTutorial.MenuButton.Overview"
android:id="@+id/gesture_tutorial_menu_overview_button_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
diff --git a/quickstep/res/layout/redesigned_gesture_tutorial_fragment.xml b/quickstep/res/layout/redesigned_gesture_tutorial_fragment.xml
index b2957aa..6c4ca2e 100644
--- a/quickstep/res/layout/redesigned_gesture_tutorial_fragment.xml
+++ b/quickstep/res/layout/redesigned_gesture_tutorial_fragment.xml
@@ -61,7 +61,7 @@
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginBottom="@dimen/gesture_tutorial_multi_row_task_view_spacing"
- android:background="@drawable/top_task_view"
+ android:background="@drawable/redesigned_top_task_view"
android:clipToOutline="true"
android:visibility="invisible"
@@ -74,7 +74,7 @@
android:id="@+id/bottom_task_view"
android:layout_width="match_parent"
android:layout_height="0dp"
- android:background="@drawable/top_task_view"
+ android:background="@drawable/redesigned_top_task_view"
android:clipToOutline="true"
android:visibility="invisible"
@@ -121,7 +121,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerVertical="true"
- android:background="@color/gesture_back_tutorial_exiting_app"
android:visibility="gone" />
<RelativeLayout
@@ -216,7 +215,6 @@
<Button
android:id="@+id/gesture_tutorial_fragment_action_button"
- style="@style/TextAppearance.GestureTutorial.ButtonLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/gesture_tutorial_action_button_background"
diff --git a/quickstep/res/layout/swipe_up_gesture_tutorial_shape.xml b/quickstep/res/layout/swipe_up_gesture_tutorial_shape.xml
index 3575e4d..d60e84f 100644
--- a/quickstep/res/layout/swipe_up_gesture_tutorial_shape.xml
+++ b/quickstep/res/layout/swipe_up_gesture_tutorial_shape.xml
@@ -13,7 +13,8 @@
-->
<View
xmlns:android="http://schemas.android.com/apk/res/android"
+ android:theme="@style/GestureTutorialActivity"
android:id="@+id/swipe_up_gesture_tutorial_shape"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:background="@color/gesture_home_tutorial_background" />
+ android:background="?attr/surfaceHome" />
diff --git a/quickstep/res/values-night/styles.xml b/quickstep/res/values-night/styles.xml
index e6b3450..ed0bd5b 100644
--- a/quickstep/res/values-night/styles.xml
+++ b/quickstep/res/values-night/styles.xml
@@ -14,7 +14,8 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<resources>
+<resources
+ xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
<style name="AllSetTheme" parent="@android:style/Theme.DeviceDefault.NoActionBar">
<item name="android:navigationBarColor">@android:color/transparent</item>
@@ -24,4 +25,58 @@
<item name="android:windowBackground">@android:color/transparent</item>
</style>
+ <style name="TextAppearance.GestureTutorial.MenuButton.Home"
+ parent="TextAppearance.GestureTutorial.MenuButton">
+ <item name="android:textColor">?attr/onSurfaceHome</item>
+ </style>
+
+ <style name="TextAppearance.GestureTutorial.MenuButton.Back"
+ parent="TextAppearance.GestureTutorial.MenuButton">
+ <item name="android:textColor">?attr/onSurfaceBack</item>
+ </style>
+
+ <style name="TextAppearance.GestureTutorial.MenuButton.Overview"
+ parent="TextAppearance.GestureTutorial.MenuButton">
+ <item name="android:textColor">?attr/onSurfaceOverview</item>
+ </style>
+
+ <style name="TextAppearance.GestureTutorial.ButtonLabel.Home"
+ parent="TextAppearance.GestureTutorial.ButtonLabel">
+ <item name="android:textColor">?attr/secondaryHome</item>
+ </style>
+
+ <style name="TextAppearance.GestureTutorial.ButtonLabel.Back"
+ parent="TextAppearance.GestureTutorial.ButtonLabel">
+ <item name="android:textColor">?attr/secondaryBack</item>
+ </style>
+
+ <style name="TextAppearance.GestureTutorial.ButtonLabel.Overview"
+ parent="TextAppearance.GestureTutorial.ButtonLabel">
+ <item name="android:textColor">?attr/secondaryOverview</item>
+ </style>
+
+ <style name="TextAppearance.GestureTutorial.MainTitle.Success.Home"
+ parent="TextAppearance.GestureTutorial.MainTitle.Home" />
+
+ <style name="TextAppearance.GestureTutorial.MainTitle.Success.Back"
+ parent="TextAppearance.GestureTutorial.MainTitle.Back" />
+
+ <style name="TextAppearance.GestureTutorial.MainTitle.Success.Overview"
+ parent="TextAppearance.GestureTutorial.MainTitle.Overview" />
+
+ <style name="GestureTutorialActivity" parent="@style/AppTheme">
+ <item name="background">@android:color/transparent</item>
+ <item name="tutorialSubtitle">@android:color/white</item>
+ <item name="surfaceContainer">?androidprv:attr/materialColorSurfaceContainer</item>
+ <item name="onSurfaceHome">?androidprv:attr/materialColorPrimaryFixedDim</item>
+ <item name="surfaceHome">?androidprv:attr/materialColorOnPrimaryFixedVariant</item>
+ <item name="secondaryHome">?androidprv:attr/materialColorOnPrimaryFixed</item>
+ <item name="onSurfaceBack">?androidprv:attr/materialColorTertiaryFixedDim</item>
+ <item name="surfaceBack">?androidprv:attr/materialColorOnTertiaryFixedVariant</item>
+ <item name="secondaryBack">?androidprv:attr/materialColorOnTertiaryFixed</item>
+ <item name="onSurfaceOverview">?androidprv:attr/materialColorPrimaryFixed</item>
+ <item name="surfaceOverview">?androidprv:attr/materialColorOnSecondaryFixedVariant</item>
+ <item name="secondaryOverview">?androidprv:attr/materialColorOnSecondaryFixed</item>
+ </style>
+
</resources>
\ No newline at end of file
diff --git a/quickstep/res/values/attrs.xml b/quickstep/res/values/attrs.xml
index f1d4dab..fb51919 100644
--- a/quickstep/res/values/attrs.xml
+++ b/quickstep/res/values/attrs.xml
@@ -28,4 +28,22 @@
<!-- Border color for a keyboard quick switch task views -->
<attr name="borderColor" format="color" />
</declare-styleable>
+
+ <!--
+ Gesture nav edu specific attributes. These attributes are used to customize Gesture nav edu
+ view lottie animation colors in XML files.
+ -->
+ <declare-styleable name="RootSandboxLayout">
+ <attr name="tutorialSubtitle" format="color" />
+ <attr name="surfaceContainer" format="color" />
+ <attr name="onSurfaceHome" format="color" />
+ <attr name="surfaceHome" format="color" />
+ <attr name="secondaryHome" format="color" />
+ <attr name="onSurfaceBack" format="color" />
+ <attr name="surfaceBack" format="color" />
+ <attr name="secondaryBack" format="color" />
+ <attr name="onSurfaceOverview" format="color" />
+ <attr name="surfaceOverview" format="color" />
+ <attr name="secondaryOverview" format="color" />
+ </declare-styleable>
</resources>
diff --git a/quickstep/res/values/colors.xml b/quickstep/res/values/colors.xml
index f69db49..c84c518 100644
--- a/quickstep/res/values/colors.xml
+++ b/quickstep/res/values/colors.xml
@@ -42,17 +42,6 @@
<color name="gesture_tutorial_fake_previous_task_view_color">#3C4043</color> <!-- Gray -->
<color name="gesture_tutorial_taskbar_color">#E8EAED</color>
- <!-- Redesigned gesture navigation tutorial -->
- <color name="gesture_home_tutorial_background">#FFAD91</color> <!-- Light Orange -->
- <color name="gesture_tutorial_workspace_background">#4B64AE</color> <!-- Indigo Blue -->
- <color name="gesture_home_tutorial_arrow">#DBF59E</color> <!-- Lime Green -->
- <color name="gesture_back_tutorial_exiting_app">#F9A2B9</color> <!-- Pink -->
- <color name="gesture_back_tutorial_instructional_shape">#217500</color> <!-- Green -->
- <color name="gesture_overview_tutorial_background">#DFF3AF</color> <!-- Light Green -->
- <color name="gesture_overview_tutorial_swipe_rect">#7E44AD</color> <!-- Purple -->
- <color name="gesture_overview_background">#CABCD6</color> <!-- Light Purple -->
- <color name="gesture_tutorial_menu_background">#1C1B1F</color> <!-- Black -->
-
<!-- Mock hotseat -->
<color name="mock_app_icon">#BDC1C6</color>
<color name="mock_search_bar">#3C4043</color>
diff --git a/quickstep/res/values/styles.xml b/quickstep/res/values/styles.xml
index ead5343..6915417 100644
--- a/quickstep/res/values/styles.xml
+++ b/quickstep/res/values/styles.xml
@@ -18,10 +18,10 @@
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
<style name="TextAppearance.GestureTutorial"
- parent="android:TextAppearance.Material.Body1" />
+ parent="@android:style/Theme.DeviceDefault.DayNight" />
<style name="TextAppearance.GestureTutorial.CallToAction"
- parent="android:TextAppearance.Material.Body2" />
+ parent="@android:style/Theme.DeviceDefault.DayNight" />
<style name="TextAppearance.GestureTutorial.Title"
parent="TextAppearance.GestureTutorial">
@@ -51,10 +51,24 @@
<style name="TextAppearance.GestureTutorial.MenuButton"
parent="TextAppearance.GestureTutorial.Feedback.Title">
<item name="android:gravity">center</item>
- <item name="android:textColor">?android:attr/textColorPrimaryInverse</item>
<item name="fontWeight">400</item>
</style>
+ <style name="TextAppearance.GestureTutorial.MenuButton.Home"
+ parent="TextAppearance.GestureTutorial.MenuButton">
+ <item name="android:textColor">?attr/secondaryHome</item>
+ </style>
+
+ <style name="TextAppearance.GestureTutorial.MenuButton.Back"
+ parent="TextAppearance.GestureTutorial.MenuButton">
+ <item name="android:textColor">?attr/secondaryBack</item>
+ </style>
+
+ <style name="TextAppearance.GestureTutorial.MenuButton.Overview"
+ parent="TextAppearance.GestureTutorial.MenuButton">
+ <item name="android:textColor">?attr/secondaryOverview</item>
+ </style>
+
<style name="TextAppearance.GestureTutorial.Feedback.Title.AllSet"
parent="TextAppearance.GestureTutorial.Feedback.Title">
<item name="android:letterSpacing">0.03</item>
@@ -110,13 +124,28 @@
<style name="TextAppearance.GestureTutorial.ButtonLabel"
parent="TextAppearance.GestureTutorial.CallToAction">
<item name="android:gravity">center</item>
- <item name="android:textColor">?android:attr/textColorPrimaryInverse</item>
+ <item name="android:textColor">?androidprv:attr/materialColorOnPrimary</item>
<item name="android:letterSpacing">0.02</item>
<item name="android:textSize">16sp</item>
<item name="android:textAllCaps">false</item>
<item name="android:fontFamily">google-sans-text-medium</item>
</style>
+ <style name="TextAppearance.GestureTutorial.ButtonLabel.Home"
+ parent="TextAppearance.GestureTutorial.ButtonLabel">
+ <item name="android:textColor">?attr/onSurfaceHome</item>
+ </style>
+
+ <style name="TextAppearance.GestureTutorial.ButtonLabel.Back"
+ parent="TextAppearance.GestureTutorial.ButtonLabel">
+ <item name="android:textColor">?attr/onSurfaceBack</item>
+ </style>
+
+ <style name="TextAppearance.GestureTutorial.ButtonLabel.Overview"
+ parent="TextAppearance.GestureTutorial.ButtonLabel">
+ <item name="android:textColor">?attr/onSurfaceOverview</item>
+ </style>
+
<style name="TextAppearance.GestureTutorial.CancelButtonLabel"
parent="TextAppearance.GestureTutorial.ButtonLabel">
<item name="android:textColor">?android:attr/colorAccent</item>
@@ -135,26 +164,45 @@
<style name="TextAppearance.GestureTutorial.MainTitle"
parent="TextAppearance.GestureTutorial">
<item name="android:textSize">36sp</item>
- <item name="android:textColor">@android:color/black</item>
<item name="android:fontFamily">google-sans</item>
</style>
+ <style name="TextAppearance.GestureTutorial.MainTitle.Home"
+ parent="TextAppearance.GestureTutorial.MainTitle">
+ <item name="android:textColor">?attr/onSurfaceHome</item>
+ </style>
+
+ <style name="TextAppearance.GestureTutorial.MainTitle.Back"
+ parent="TextAppearance.GestureTutorial.MainTitle">
+ <item name="android:textColor">?attr/onSurfaceBack</item>
+ </style>
+
+ <style name="TextAppearance.GestureTutorial.MainTitle.Overview"
+ parent="TextAppearance.GestureTutorial.MainTitle">
+ <item name="android:textColor">?attr/onSurfaceOverview</item>
+ </style>
+
+ <style name="TextAppearance.GestureTutorial.MainTitle.Success.Home"
+ parent="TextAppearance.GestureTutorial.MainTitle.Home">
+ <item name="android:textColor">?attr/secondaryHome</item>
+ </style>
+
+ <style name="TextAppearance.GestureTutorial.MainTitle.Success.Back"
+ parent="TextAppearance.GestureTutorial.MainTitle.Back">
+ <item name="android:textColor">?attr/secondaryBack</item>
+ </style>
+
+ <style name="TextAppearance.GestureTutorial.MainTitle.Success.Overview"
+ parent="TextAppearance.GestureTutorial.MainTitle.Overview">
+ <item name="android:textColor">?attr/secondaryOverview</item>
+ </style>
+
<style name="TextAppearance.GestureTutorial.MainSubtitle"
parent="TextAppearance.GestureTutorial.Subtitle">
<item name="android:textSize">16sp</item>
<item name="android:letterSpacing">0.02</item>
- <item name="android:textColor">@android:color/black</item>
<item name="android:fontFamily">google-sans-text</item>
- </style>
-
- <style name="TextAppearance.GestureTutorial.SuccessTitle"
- parent="TextAppearance.GestureTutorial.MainTitle">
- <item name="android:textColor">@android:color/white</item>
- </style>
-
- <style name="TextAppearance.GestureTutorial.SuccessSubtitle"
- parent="TextAppearance.GestureTutorial.MainSubtitle">
- <item name="android:textColor">@android:color/white</item>
+ <item name="android:textColor">?attr/tutorialSubtitle</item>
</style>
<style name="AllSetTheme" parent="@android:style/Theme.DeviceDefault.Light.NoActionBar">
@@ -226,8 +274,18 @@
<item name="android:textColor">?androidprv:attr/materialColorOnSurfaceInverse</item>
</style>
- <style name="GestureTutorialActivity"
- parent="@style/AppTheme">
+ <style name="GestureTutorialActivity" parent="@style/AppTheme">
<item name="background">@android:color/transparent</item>
+ <item name="tutorialSubtitle">@android:color/black</item>
+ <item name="surfaceContainer">?androidprv:attr/materialColorSurfaceContainer</item>
+ <item name="onSurfaceHome">?androidprv:attr/materialColorPrimaryFixed</item>
+ <item name="surfaceHome">@android:color/system_accent1_300</item>
+ <item name="secondaryHome">?androidprv:attr/materialColorOnPrimaryFixedVariant</item>
+ <item name="onSurfaceBack">?androidprv:attr/materialColorTertiaryFixed</item>
+ <item name="surfaceBack">@android:color/system_accent3_300</item>
+ <item name="secondaryBack">?androidprv:attr/materialColorOnTertiaryFixedVariant</item>
+ <item name="onSurfaceOverview">?androidprv:attr/materialColorPrimaryFixed</item>
+ <item name="surfaceOverview">@android:color/system_accent2_300</item>
+ <item name="secondaryOverview">?androidprv:attr/materialColorOnSecondaryFixedVariant</item>
</style>
</resources>
diff --git a/quickstep/src/com/android/quickstep/interaction/BackGestureTutorialController.java b/quickstep/src/com/android/quickstep/interaction/BackGestureTutorialController.java
index ab76fb4..93dd4e6 100644
--- a/quickstep/src/com/android/quickstep/interaction/BackGestureTutorialController.java
+++ b/quickstep/src/com/android/quickstep/interaction/BackGestureTutorialController.java
@@ -63,6 +63,28 @@
}
@Override
+ public int getTitleTextAppearance() {
+ return R.style.TextAppearance_GestureTutorial_MainTitle_Back;
+ }
+
+ @Override
+ public int getSuccessTitleTextAppearance() {
+ return R.style.TextAppearance_GestureTutorial_MainTitle_Success_Back;
+ }
+
+ @Override
+ public int getDoneButtonTextAppearance() {
+ return R.style.TextAppearance_GestureTutorial_ButtonLabel_Back;
+ }
+
+ @Override
+ public int getDoneButtonColor() {
+ return Utilities.isDarkTheme(mContext)
+ ? mTutorialFragment.mRootView.mColorOnSurfaceBack
+ : mTutorialFragment.mRootView.mColorSecondaryBack;
+ }
+
+ @Override
protected int getMockAppTaskLayoutResId() {
return getMockAppTaskCurrentPageLayoutResId();
}
@@ -95,8 +117,13 @@
}
@Override
- protected int getSwipeActionColorResId() {
- return R.color.gesture_tutorial_workspace_background;
+ protected int getSwipeActionColor() {
+ return mTutorialFragment.mRootView.mColorSurfaceContainer;
+ }
+
+ @Override
+ protected int getExitingAppColor() {
+ return mTutorialFragment.mRootView.mColorSurfaceBack;
}
@Override
diff --git a/quickstep/src/com/android/quickstep/interaction/HomeGestureTutorialController.java b/quickstep/src/com/android/quickstep/interaction/HomeGestureTutorialController.java
index 0497f0a..1c8750a 100644
--- a/quickstep/src/com/android/quickstep/interaction/HomeGestureTutorialController.java
+++ b/quickstep/src/com/android/quickstep/interaction/HomeGestureTutorialController.java
@@ -22,6 +22,7 @@
import android.os.Build;
import com.android.launcher3.R;
+import com.android.launcher3.Utilities;
import com.android.quickstep.interaction.EdgeBackGestureHandler.BackGestureResult;
import com.android.quickstep.interaction.NavBarGestureHandler.NavBarGestureResult;
import com.android.quickstep.util.LottieAnimationColorUtils;
@@ -37,10 +38,9 @@
if (ENABLE_NEW_GESTURE_NAV_TUTORIAL.get()) {
LottieAnimationColorUtils.updateColors(
mAnimatedGestureDemonstration,
- Map.of(".onSurfaceHome", R.color.gesture_tutorial_workspace_background,
- ".surfaceHome", R.color.gesture_home_tutorial_background,
- ".arrow", R.color.gesture_home_tutorial_arrow),
- mContext.getTheme());
+ Map.of(".onSurfaceHome", fragment.mRootView.mColorOnSurfaceHome,
+ ".surfaceHome", fragment.mRootView.mColorSurfaceHome,
+ ".arrow", fragment.mRootView.mColorSecondaryHome));
}
}
@@ -71,6 +71,28 @@
}
@Override
+ public int getTitleTextAppearance() {
+ return R.style.TextAppearance_GestureTutorial_MainTitle_Home;
+ }
+
+ @Override
+ public int getSuccessTitleTextAppearance() {
+ return R.style.TextAppearance_GestureTutorial_MainTitle_Success_Home;
+ }
+
+ @Override
+ public int getDoneButtonTextAppearance() {
+ return R.style.TextAppearance_GestureTutorial_ButtonLabel_Home;
+ }
+
+ @Override
+ public int getDoneButtonColor() {
+ return Utilities.isDarkTheme(mContext)
+ ? mTutorialFragment.mRootView.mColorOnSurfaceHome
+ : mTutorialFragment.mRootView.mColorSecondaryHome;
+ }
+
+ @Override
protected int getMockAppTaskLayoutResId() {
return ENABLE_NEW_GESTURE_NAV_TUTORIAL.get()
? R.layout.swipe_up_gesture_tutorial_shape
@@ -89,8 +111,13 @@
}
@Override
- protected int getSwipeActionColorResId() {
- return R.color.gesture_tutorial_workspace_background;
+ protected int getSwipeActionColor() {
+ return mTutorialFragment.mRootView.mColorSurfaceContainer;
+ }
+
+ @Override
+ protected int getExitingAppColor() {
+ return mTutorialFragment.mRootView.mColorSurfaceHome;
}
@Override
diff --git a/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialController.java b/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialController.java
index c5d0ebe..f280dec 100644
--- a/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialController.java
+++ b/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialController.java
@@ -28,6 +28,7 @@
import android.view.View;
import com.android.launcher3.R;
+import com.android.launcher3.Utilities;
import com.android.launcher3.anim.AnimatedFloat;
import com.android.launcher3.anim.PendingAnimation;
import com.android.quickstep.SwipeUpAnimationLogic;
@@ -69,6 +70,28 @@
}
@Override
+ public int getTitleTextAppearance() {
+ return R.style.TextAppearance_GestureTutorial_MainTitle_Overview;
+ }
+
+ @Override
+ public int getSuccessTitleTextAppearance() {
+ return R.style.TextAppearance_GestureTutorial_MainTitle_Success_Overview;
+ }
+
+ @Override
+ public int getDoneButtonTextAppearance() {
+ return R.style.TextAppearance_GestureTutorial_ButtonLabel_Overview;
+ }
+
+ @Override
+ public int getDoneButtonColor() {
+ return Utilities.isDarkTheme(mContext)
+ ? mTutorialFragment.mRootView.mColorOnSurfaceOverview
+ : mTutorialFragment.mRootView.mColorSecondaryOverview;
+ }
+
+ @Override
protected int getMockAppTaskLayoutResId() {
return ENABLE_NEW_GESTURE_NAV_TUTORIAL.get()
? R.layout.gesture_tutorial_mock_task_view
@@ -87,15 +110,21 @@
}
@Override
- protected int getSwipeActionColorResId() {
- return R.color.gesture_overview_background;
+ protected int getSwipeActionColor() {
+ return mTutorialFragment.mRootView.mColorSurfaceOverview;
}
@Override
- protected int getMockPreviousAppTaskThumbnailColorResId() {
+ protected int getExitingAppColor() {
+ return mTutorialFragment.mRootView.mColorOnSurfaceOverview;
+ }
+
+ @Override
+ protected int getMockPreviousAppTaskThumbnailColor() {
return ENABLE_NEW_GESTURE_NAV_TUTORIAL.get()
- ? R.color.gesture_overview_tutorial_swipe_rect
- : R.color.gesture_tutorial_fake_previous_task_view_color;
+ ? mTutorialFragment.mRootView.mColorSurfaceContainer
+ : mContext.getResources().getColor(
+ R.color.gesture_tutorial_fake_previous_task_view_color);
}
@Override
@@ -213,7 +242,7 @@
}
private void onSuccessAnimationComplete() {
- setLauncherViewColor(R.color.gesture_overview_tutorial_swipe_rect);
+ mFakeLauncherView.setBackgroundColor(getMockPreviousAppTaskThumbnailColor());
showSuccessFeedback();
}
}
diff --git a/quickstep/src/com/android/quickstep/interaction/RootSandboxLayout.java b/quickstep/src/com/android/quickstep/interaction/RootSandboxLayout.java
index b508484..affedb9 100644
--- a/quickstep/src/com/android/quickstep/interaction/RootSandboxLayout.java
+++ b/quickstep/src/com/android/quickstep/interaction/RootSandboxLayout.java
@@ -18,6 +18,8 @@
import static com.android.launcher3.config.FeatureFlags.ENABLE_NEW_GESTURE_NAV_TUTORIAL;
import android.content.Context;
+import android.content.res.TypedArray;
+import android.graphics.Color;
import android.graphics.Insets;
import android.graphics.Rect;
import android.util.AttributeSet;
@@ -26,7 +28,9 @@
import android.view.WindowInsets;
import android.widget.RelativeLayout;
+import androidx.annotation.ColorInt;
import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
import androidx.fragment.app.FragmentManager;
import com.android.launcher3.R;
@@ -39,21 +43,70 @@
private final Rect mTempInclusionBounds = new Rect();
private final Rect mTempExclusionBounds = new Rect();
+ @ColorInt final int mColorSurfaceContainer;
+ @ColorInt final int mColorOnSurfaceHome;
+ @ColorInt final int mColorSurfaceHome;
+ @ColorInt final int mColorSecondaryHome;
+ @ColorInt final int mColorOnSurfaceBack;
+ @ColorInt final int mColorSurfaceBack;
+ @ColorInt final int mColorSecondaryBack;
+ @ColorInt final int mColorOnSurfaceOverview;
+ @ColorInt final int mColorSurfaceOverview;
+ @ColorInt final int mColorSecondaryOverview;
+
private View mFeedbackView;
private View mTutorialStepView;
private View mSkipButton;
private View mDoneButton;
public RootSandboxLayout(Context context) {
- super(context);
+ this(context, null);
}
public RootSandboxLayout(Context context, AttributeSet attrs) {
- super(context, attrs);
+ this(context, attrs, 0);
}
public RootSandboxLayout(Context context, AttributeSet attrs, int defStyleAttr) {
- super(context, attrs, defStyleAttr);
+ this(context, attrs, defStyleAttr, 0);
+ }
+
+ public RootSandboxLayout(
+ @NonNull Context context,
+ @Nullable AttributeSet attrs,
+ int defStyleAttr,
+ int defStyleRes) {
+ super(context, attrs, defStyleAttr, defStyleRes);
+ TypedArray ta = context.obtainStyledAttributes(
+ attrs,
+ R.styleable.RootSandboxLayout,
+ defStyleAttr,
+ defStyleRes);
+ boolean isDarkTheme = Utilities.isDarkTheme(context);
+ int colorSurface = isDarkTheme ? Color.BLACK : Color.WHITE;
+ int colorOnSurface = isDarkTheme ? Color.WHITE : Color.BLACK;
+ int colorSecondary = Color.GRAY;
+
+ mColorSurfaceContainer = ta.getColor(
+ R.styleable.RootSandboxLayout_surfaceContainer, colorSurface);
+ mColorOnSurfaceHome = ta.getColor(
+ R.styleable.RootSandboxLayout_onSurfaceHome, colorOnSurface);
+ mColorSurfaceHome = ta.getColor(R.styleable.RootSandboxLayout_surfaceHome, colorSurface);
+ mColorSecondaryHome = ta.getColor(
+ R.styleable.RootSandboxLayout_secondaryHome, colorSecondary);
+ mColorOnSurfaceBack = ta.getColor(
+ R.styleable.RootSandboxLayout_onSurfaceBack, colorOnSurface);
+ mColorSurfaceBack = ta.getColor(R.styleable.RootSandboxLayout_surfaceBack, colorSurface);
+ mColorSecondaryBack = ta.getColor(
+ R.styleable.RootSandboxLayout_secondaryBack, colorSecondary);
+ mColorOnSurfaceOverview = ta.getColor(
+ R.styleable.RootSandboxLayout_onSurfaceOverview, colorOnSurface);
+ mColorSurfaceOverview = ta.getColor(
+ R.styleable.RootSandboxLayout_surfaceOverview, colorSurface);
+ mColorSecondaryOverview = ta.getColor(
+ R.styleable.RootSandboxLayout_secondaryOverview, colorSecondary);
+
+ ta.recycle();
}
@Override
diff --git a/quickstep/src/com/android/quickstep/interaction/TutorialController.java b/quickstep/src/com/android/quickstep/interaction/TutorialController.java
index 198305f..22116e1 100644
--- a/quickstep/src/com/android/quickstep/interaction/TutorialController.java
+++ b/quickstep/src/com/android/quickstep/interaction/TutorialController.java
@@ -26,7 +26,6 @@
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
-import android.annotation.ColorRes;
import android.annotation.RawRes;
import android.content.Context;
import android.content.pm.PackageManager;
@@ -47,11 +46,13 @@
import android.widget.TextView;
import androidx.annotation.CallSuper;
+import androidx.annotation.ColorInt;
import androidx.annotation.DrawableRes;
import androidx.annotation.LayoutRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
+import androidx.annotation.StyleRes;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.content.res.AppCompatResources;
@@ -258,15 +259,17 @@
return NO_ID;
}
- @ColorRes
- protected int getMockPreviousAppTaskThumbnailColorResId() {
- return R.color.gesture_tutorial_fake_previous_task_view_color;
+ @ColorInt
+ protected int getMockPreviousAppTaskThumbnailColor() {
+ return mContext.getResources().getColor(
+ R.color.gesture_tutorial_fake_previous_task_view_color);
}
- @ColorRes
- protected int getSwipeActionColorResId() {
- return NO_ID;
- }
+ @ColorInt
+ protected abstract int getSwipeActionColor();
+
+ @ColorInt
+ protected abstract int getExitingAppColor();
@DrawableRes
public int getMockAppIconResId() {
@@ -304,6 +307,24 @@
return NO_ID;
}
+ @StyleRes
+ public int getTitleTextAppearance() {
+ return NO_ID;
+ }
+
+ @StyleRes
+ public int getSuccessTitleTextAppearance() {
+ return NO_ID;
+ }
+
+ @StyleRes
+ public int getDoneButtonTextAppearance() {
+ return NO_ID;
+ }
+
+ @ColorInt
+ public abstract int getDoneButtonColor();
+
void showFeedback() {
if (mGestureCompleted) {
mFeedbackView.setTranslationY(0);
@@ -417,9 +438,7 @@
private void showSuccessPage() {
mCheckmarkAnimation.setVisibility(View.VISIBLE);
mCheckmarkAnimation.playAnimation();
- mFeedbackTitleView.setTextAppearance(R.style.TextAppearance_GestureTutorial_SuccessTitle);
- mFeedbackSubtitleView.setTextAppearance(
- R.style.TextAppearance_GestureTutorial_SuccessSubtitle);
+ mFeedbackTitleView.setTextAppearance(mContext, getSuccessTitleTextAppearance());
}
public boolean isGestureCompleted() {
@@ -536,6 +555,9 @@
updateLayout();
if (ENABLE_NEW_GESTURE_NAV_TUTORIAL.get()) {
+ mFeedbackTitleView.setTextAppearance(mContext, getTitleTextAppearance());
+ mDoneButton.setTextAppearance(mContext, getDoneButtonTextAppearance());
+ mDoneButton.getBackground().setTint(getDoneButtonColor());
mCheckmarkAnimation.setAnimation(mTutorialFragment.isAtFinalStep()
? R.raw.checkmark_animation_end
: R.raw.checkmark_animation_in_progress);
@@ -560,8 +582,7 @@
protected void resetViewsForBackGesture() {
mFakeTaskView.setVisibility(View.VISIBLE);
- mFakeTaskView.setBackgroundColor(
- mContext.getColor(R.color.gesture_tutorial_workspace_background));
+ mFakeTaskView.setBackgroundColor(getSwipeActionColor());
mExitingAppView.setVisibility(View.VISIBLE);
// reset the exiting app's dimensions
@@ -649,26 +670,26 @@
}
}
- void setLauncherViewColor(@ColorRes int backgroundColorRes) {
- mFakeLauncherView.setBackgroundColor(mContext.getColor(backgroundColorRes));
- }
-
private void updateDrawables() {
if (mContext != null) {
mTutorialFragment.getRootView().setBackground(AppCompatResources.getDrawable(
mContext, getMockWallpaperResId()));
mTutorialFragment.updateFeedbackAnimation();
- setLauncherViewColor(ENABLE_NEW_GESTURE_NAV_TUTORIAL.get()
- ? getSwipeActionColorResId() : R.color.gesture_tutorial_fake_wallpaper_color);
+ mFakeLauncherView.setBackgroundColor(ENABLE_NEW_GESTURE_NAV_TUTORIAL.get()
+ ? getSwipeActionColor()
+ : mContext.getColor(R.color.gesture_tutorial_fake_wallpaper_color));
updateFakeViewLayout(mFakeHotseatView, getMockHotseatResId());
mHotseatIconView = mFakeHotseatView.findViewById(R.id.hotseat_icon_1);
updateFakeViewLayout(mFakeTaskView, getMockAppTaskLayoutResId());
mFakeTaskView.animate().alpha(1).setListener(
AnimatorListeners.forSuccessCallback(() -> mFakeTaskView.animate().cancel()));
- mFakePreviousTaskView.setFakeTaskViewFillColor(mContext.getResources().getColor(
- getMockPreviousAppTaskThumbnailColorResId()));
+ mFakePreviousTaskView.setFakeTaskViewFillColor(getMockPreviousAppTaskThumbnailColor());
mFakeIconView.setBackground(AppCompatResources.getDrawable(
mContext, getMockAppIconResId()));
+
+ if (ENABLE_NEW_GESTURE_NAV_TUTORIAL.get()) {
+ mExitingAppView.setBackgroundColor(getExitingAppColor());
+ }
}
}