From ff322310a319d6ac671bf045f071adcf71c5da6f Mon Sep 17 00:00:00 2001 From: Schneider Victor-tulias Date: Thu, 22 Jul 2021 16:24:10 -0700 Subject: [PATCH] Convert gesture navigation tutorial still image vector drawables to layout files Bug: 192939067 Test: manual, started full tutorial, started home, back and overview individually, locked and unlocked phone mid-tutorial step. Change-Id: I1cba811c556139bc9ba52459f1b27f21eb156ac0 --- ...e.xml => gesture_tutorial_motion_home.xml} | 2 +- ...esture_tutorial_motion_home_light_mode.xml | 1254 ------------- ...l => gesture_tutorial_motion_overview.xml} | 2 +- .../res}/drawable/gesture_tutorial_ripple.xml | 0 quickstep/res/drawable/mock_conversation.xml | 212 --- .../res/drawable/mock_conversations_list.xml | 361 ---- .../res/drawable/mock_webpage_dark_mode.xml | 251 --- .../res/drawable/mock_webpage_light_mode.xml | 263 --- .../res/layout/gesture_tutorial_dialog.xml | 14 + .../res/layout/gesture_tutorial_fragment.xml | 2 +- .../gesture_tutorial_mock_conversation.xml | 242 +++ ...esture_tutorial_mock_conversation_list.xml | 394 ++++ .../layout/gesture_tutorial_mock_webpage.xml | 274 +++ quickstep/res/values-night/colors.xml | 25 + quickstep/res/values/colors.xml | 38 +- .../BackGestureTutorialController.java | 20 +- .../interaction/EdgeBackGesturePanel.java | 4 +- .../HomeGestureTutorialController.java | 4 +- .../HomeGestureTutorialFragment.java | 4 +- .../OverviewGestureTutorialController.java | 4 +- .../OverviewGestureTutorialFragment.java | 4 +- .../interaction/TutorialController.java | 30 +- ...re_tutorial_motion_overview_light_mode.xml | 1587 ----------------- res/values/colors.xml | 9 - 24 files changed, 1030 insertions(+), 3970 deletions(-) rename quickstep/res/drawable/{gesture_tutorial_motion_home_dark_mode.xml => gesture_tutorial_motion_home.xml} (99%) delete mode 100644 quickstep/res/drawable/gesture_tutorial_motion_home_light_mode.xml rename quickstep/res/drawable/{gesture_tutorial_motion_overview_dark_mode.xml => gesture_tutorial_motion_overview.xml} (99%) rename {res => quickstep/res}/drawable/gesture_tutorial_ripple.xml (100%) delete mode 100644 quickstep/res/drawable/mock_conversation.xml delete mode 100644 quickstep/res/drawable/mock_conversations_list.xml delete mode 100644 quickstep/res/drawable/mock_webpage_dark_mode.xml delete mode 100644 quickstep/res/drawable/mock_webpage_light_mode.xml create mode 100644 quickstep/res/layout/gesture_tutorial_mock_conversation.xml create mode 100644 quickstep/res/layout/gesture_tutorial_mock_conversation_list.xml create mode 100644 quickstep/res/layout/gesture_tutorial_mock_webpage.xml create mode 100644 quickstep/res/values-night/colors.xml delete mode 100644 res/drawable/gesture_tutorial_motion_overview_light_mode.xml diff --git a/quickstep/res/drawable/gesture_tutorial_motion_home_dark_mode.xml b/quickstep/res/drawable/gesture_tutorial_motion_home.xml similarity index 99% rename from quickstep/res/drawable/gesture_tutorial_motion_home_dark_mode.xml rename to quickstep/res/drawable/gesture_tutorial_motion_home.xml index aff35c1bce..020d0b1319 100644 --- a/quickstep/res/drawable/gesture_tutorial_motion_home_dark_mode.xml +++ b/quickstep/res/drawable/gesture_tutorial_motion_home.xml @@ -922,7 +922,7 @@ diff --git a/quickstep/res/drawable/gesture_tutorial_motion_home_light_mode.xml b/quickstep/res/drawable/gesture_tutorial_motion_home_light_mode.xml deleted file mode 100644 index 98d97ad62d..0000000000 --- a/quickstep/res/drawable/gesture_tutorial_motion_home_light_mode.xml +++ /dev/null @@ -1,1254 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/quickstep/res/drawable/gesture_tutorial_motion_overview_dark_mode.xml b/quickstep/res/drawable/gesture_tutorial_motion_overview.xml similarity index 99% rename from quickstep/res/drawable/gesture_tutorial_motion_overview_dark_mode.xml rename to quickstep/res/drawable/gesture_tutorial_motion_overview.xml index b007d20f34..3f8b3f58b9 100644 --- a/quickstep/res/drawable/gesture_tutorial_motion_overview_dark_mode.xml +++ b/quickstep/res/drawable/gesture_tutorial_motion_overview.xml @@ -860,7 +860,7 @@ diff --git a/res/drawable/gesture_tutorial_ripple.xml b/quickstep/res/drawable/gesture_tutorial_ripple.xml similarity index 100% rename from res/drawable/gesture_tutorial_ripple.xml rename to quickstep/res/drawable/gesture_tutorial_ripple.xml diff --git a/quickstep/res/drawable/mock_conversation.xml b/quickstep/res/drawable/mock_conversation.xml deleted file mode 100644 index 272d9ed8a8..0000000000 --- a/quickstep/res/drawable/mock_conversation.xml +++ /dev/null @@ -1,212 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/quickstep/res/drawable/mock_conversations_list.xml b/quickstep/res/drawable/mock_conversations_list.xml deleted file mode 100644 index 2dbc88f0bf..0000000000 --- a/quickstep/res/drawable/mock_conversations_list.xml +++ /dev/null @@ -1,361 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/quickstep/res/drawable/mock_webpage_dark_mode.xml b/quickstep/res/drawable/mock_webpage_dark_mode.xml deleted file mode 100644 index 93b22b7d31..0000000000 --- a/quickstep/res/drawable/mock_webpage_dark_mode.xml +++ /dev/null @@ -1,251 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/quickstep/res/drawable/mock_webpage_light_mode.xml b/quickstep/res/drawable/mock_webpage_light_mode.xml deleted file mode 100644 index 98abb92ab7..0000000000 --- a/quickstep/res/drawable/mock_webpage_light_mode.xml +++ /dev/null @@ -1,263 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/quickstep/res/layout/gesture_tutorial_dialog.xml b/quickstep/res/layout/gesture_tutorial_dialog.xml index 59bf7b965c..db6ec8533f 100644 --- a/quickstep/res/layout/gesture_tutorial_dialog.xml +++ b/quickstep/res/layout/gesture_tutorial_dialog.xml @@ -1,4 +1,18 @@ + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/quickstep/res/layout/gesture_tutorial_mock_conversation_list.xml b/quickstep/res/layout/gesture_tutorial_mock_conversation_list.xml new file mode 100644 index 0000000000..ad6b165019 --- /dev/null +++ b/quickstep/res/layout/gesture_tutorial_mock_conversation_list.xml @@ -0,0 +1,394 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/quickstep/res/layout/gesture_tutorial_mock_webpage.xml b/quickstep/res/layout/gesture_tutorial_mock_webpage.xml new file mode 100644 index 0000000000..ab00a113b4 --- /dev/null +++ b/quickstep/res/layout/gesture_tutorial_mock_webpage.xml @@ -0,0 +1,274 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/quickstep/res/values-night/colors.xml b/quickstep/res/values-night/colors.xml new file mode 100644 index 0000000000..c3b253654e --- /dev/null +++ b/quickstep/res/values-night/colors.xml @@ -0,0 +1,25 @@ + + + + + #99000000 + + #000000 + + #202124 + #3c4043 + + \ No newline at end of file diff --git a/quickstep/res/values/colors.xml b/quickstep/res/values/colors.xml index 17980f0eeb..47552924ef 100644 --- a/quickstep/res/values/colors.xml +++ b/quickstep/res/values/colors.xml @@ -14,8 +14,6 @@ limitations under the License. --> - #FFFFFFFF - #99000000 #fff #39000000 @@ -31,4 +29,40 @@ #EBffffff #99000000 + + + #FFFFFFFF + + #f9f9f9 + #A0C2F9 + #6DA1FF + + #3C4043 + #FF000000 + #B7F29F + + + #f1f3f4 + #e8eaed + #dadce0 + #bdc1c6 + #e8eaed + #dadce0 + #dadce0 + + + #dadce0 + #e8eaed + #f8f9fa + #9aa0a6 + #bdc1c6 + #bdc1c6 + + + #f1f3f4 + #6e7175 + #9a9a9a + #e8eaed + #80868b + #bdc1c6 \ No newline at end of file diff --git a/quickstep/src/com/android/quickstep/interaction/BackGestureTutorialController.java b/quickstep/src/com/android/quickstep/interaction/BackGestureTutorialController.java index 3cb22f4ffe..1afcb321a5 100644 --- a/quickstep/src/com/android/quickstep/interaction/BackGestureTutorialController.java +++ b/quickstep/src/com/android/quickstep/interaction/BackGestureTutorialController.java @@ -18,10 +18,9 @@ package com.android.quickstep.interaction; import static com.android.quickstep.interaction.TutorialController.TutorialType.BACK_NAVIGATION; import static com.android.quickstep.interaction.TutorialController.TutorialType.BACK_NAVIGATION_COMPLETE; +import android.annotation.LayoutRes; import android.graphics.PointF; -import androidx.appcompat.content.res.AppCompatResources; - import com.android.launcher3.R; import com.android.quickstep.interaction.EdgeBackGestureHandler.BackGestureResult; import com.android.quickstep.interaction.NavBarGestureHandler.NavBarGestureResult; @@ -44,8 +43,18 @@ final class BackGestureTutorialController extends TutorialController { } @Override - protected int getMockAppTaskThumbnailResId(boolean forDarkMode) { - return R.drawable.mock_conversation; + protected int getMockAppTaskLayoutResId() { + return getMockAppTaskCurrentPageLayoutResId(); + } + + @LayoutRes + int getMockAppTaskCurrentPageLayoutResId() { + return R.layout.gesture_tutorial_mock_conversation; + } + + @LayoutRes + int getMockAppTaskPreviousPageLayoutResId() { + return R.layout.gesture_tutorial_mock_conversation_list; } @Override @@ -72,8 +81,7 @@ final class BackGestureTutorialController extends TutorialController { case BACK_COMPLETED_FROM_RIGHT: mTutorialFragment.releaseGestureVideoView(); hideFeedback(true); - mFakeTaskView.setBackground(AppCompatResources.getDrawable(mContext, - R.drawable.mock_conversations_list)); + updateFakeAppTaskViewLayout(getMockAppTaskPreviousPageLayoutResId()); int subtitleResId = mTutorialFragment.isAtFinalStep() ? R.string.back_gesture_feedback_complete_without_follow_up : R.string.back_gesture_feedback_complete_with_overview_follow_up; diff --git a/quickstep/src/com/android/quickstep/interaction/EdgeBackGesturePanel.java b/quickstep/src/com/android/quickstep/interaction/EdgeBackGesturePanel.java index 0521db4d1b..7465db3025 100644 --- a/quickstep/src/com/android/quickstep/interaction/EdgeBackGesturePanel.java +++ b/quickstep/src/com/android/quickstep/interaction/EdgeBackGesturePanel.java @@ -282,9 +282,7 @@ public class EdgeBackGesturePanel extends View { .setDampingRatio(SpringForce.DAMPING_RATIO_LOW_BOUNCY)); int currentNightMode = context.getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK; - mPaint.setColor(context.getColor(currentNightMode == Configuration.UI_MODE_NIGHT_YES - ? R.color.back_arrow_color_light - : R.color.back_arrow_color_dark)); + mPaint.setColor(context.getColor(R.color.gesture_tutorial_back_arrow_color)); loadDimens(); updateArrowDirection(); diff --git a/quickstep/src/com/android/quickstep/interaction/HomeGestureTutorialController.java b/quickstep/src/com/android/quickstep/interaction/HomeGestureTutorialController.java index 819c91c55b..10a0b2e87b 100644 --- a/quickstep/src/com/android/quickstep/interaction/HomeGestureTutorialController.java +++ b/quickstep/src/com/android/quickstep/interaction/HomeGestureTutorialController.java @@ -42,8 +42,8 @@ final class HomeGestureTutorialController extends SwipeUpGestureTutorialControll } @Override - protected int getMockAppTaskThumbnailResId(boolean forDarkMode) { - return forDarkMode ? R.drawable.mock_webpage_dark_mode : R.drawable.mock_webpage_light_mode; + protected int getMockAppTaskLayoutResId() { + return R.layout.gesture_tutorial_mock_webpage; } @Override diff --git a/quickstep/src/com/android/quickstep/interaction/HomeGestureTutorialFragment.java b/quickstep/src/com/android/quickstep/interaction/HomeGestureTutorialFragment.java index 9572637b0f..9206910bdb 100644 --- a/quickstep/src/com/android/quickstep/interaction/HomeGestureTutorialFragment.java +++ b/quickstep/src/com/android/quickstep/interaction/HomeGestureTutorialFragment.java @@ -25,9 +25,7 @@ public class HomeGestureTutorialFragment extends TutorialFragment { @Nullable @Override Integer getFeedbackVideoResId(boolean forDarkMode) { - return forDarkMode - ? R.drawable.gesture_tutorial_motion_home_dark_mode - : R.drawable.gesture_tutorial_motion_home_light_mode; + return R.drawable.gesture_tutorial_motion_home; } @Nullable diff --git a/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialController.java b/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialController.java index 77ddb2b320..9e2c0babf4 100644 --- a/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialController.java +++ b/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialController.java @@ -49,8 +49,8 @@ final class OverviewGestureTutorialController extends SwipeUpGestureTutorialCont } @Override - protected int getMockAppTaskThumbnailResId(boolean forDarkMode) { - return R.drawable.mock_conversations_list; + protected int getMockAppTaskLayoutResId() { + return R.layout.gesture_tutorial_mock_conversation_list; } @Override diff --git a/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialFragment.java b/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialFragment.java index d2ec327c81..601358260f 100644 --- a/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialFragment.java +++ b/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialFragment.java @@ -25,9 +25,7 @@ public class OverviewGestureTutorialFragment extends TutorialFragment { @Nullable @Override Integer getFeedbackVideoResId(boolean forDarkMode) { - return forDarkMode - ? R.drawable.gesture_tutorial_motion_overview_dark_mode - : R.drawable.gesture_tutorial_motion_overview_light_mode; + return R.drawable.gesture_tutorial_motion_overview; } @Nullable diff --git a/quickstep/src/com/android/quickstep/interaction/TutorialController.java b/quickstep/src/com/android/quickstep/interaction/TutorialController.java index 4b4e7e6753..e90ca50619 100644 --- a/quickstep/src/com/android/quickstep/interaction/TutorialController.java +++ b/quickstep/src/com/android/quickstep/interaction/TutorialController.java @@ -16,6 +16,8 @@ package com.android.quickstep.interaction; import static android.view.View.GONE; +import static android.view.View.NO_ID; +import static android.view.View.inflate; import android.content.Context; import android.content.pm.PackageManager; @@ -29,12 +31,14 @@ import android.view.View; import android.view.ViewGroup; import android.view.accessibility.AccessibilityEvent; import android.widget.Button; +import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.RelativeLayout; import android.widget.TextView; import androidx.annotation.CallSuper; import androidx.annotation.DrawableRes; +import androidx.annotation.LayoutRes; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.StringRes; @@ -73,7 +77,7 @@ abstract class TutorialController implements BackGestureAttemptCallback, final RelativeLayout mFakeLauncherView; final ImageView mFakeHotseatView; final ClipIconView mFakeIconView; - final View mFakeTaskView; + final FrameLayout mFakeTaskView; final View mFakePreviousTaskView; final View mRippleView; final RippleDrawable mRippleDrawable; @@ -134,9 +138,9 @@ abstract class TutorialController implements BackGestureAttemptCallback, return R.drawable.default_sandbox_mock_launcher; } - @DrawableRes - protected int getMockAppTaskThumbnailResId(boolean forDarkMode) { - return R.drawable.default_sandbox_app_task_thumbnail; + @LayoutRes + protected int getMockAppTaskLayoutResId() { + return View.NO_ID; } @DrawableRes @@ -395,6 +399,17 @@ abstract class TutorialController implements BackGestureAttemptCallback, mActionButton.setOnClickListener(this::onActionButtonClicked); } + void updateFakeAppTaskViewLayout(@LayoutRes int mockAppTaskLayoutResId) { + mFakeTaskView.removeAllViews(); + if (mockAppTaskLayoutResId != NO_ID) { + mFakeTaskView.addView( + inflate(mContext, mockAppTaskLayoutResId, null), + new FrameLayout.LayoutParams( + ViewGroup.LayoutParams.MATCH_PARENT, + ViewGroup.LayoutParams.MATCH_PARENT)); + } + } + private void updateSubtext() { mTutorialStepView.setTutorialProgress( mTutorialFragment.getCurrentStep(), mTutorialFragment.getNumSteps()); @@ -406,13 +421,10 @@ abstract class TutorialController implements BackGestureAttemptCallback, mContext, getMockWallpaperResId())); mTutorialFragment.updateFeedbackVideo(); mFakeLauncherView.setBackgroundColor( - mContext.getColor(Utilities.isDarkTheme(mContext) - ? R.color.fake_wallpaper_color_dark_mode - : R.color.fake_wallpaper_color_light_mode)); + mContext.getColor(R.color.gesture_tutorial_fake_wallpaper_color)); mFakeHotseatView.setImageDrawable(AppCompatResources.getDrawable( mContext, getMockHotseatResId())); - mFakeTaskView.setBackground(AppCompatResources.getDrawable( - mContext, getMockAppTaskThumbnailResId(Utilities.isDarkTheme(mContext)))); + updateFakeAppTaskViewLayout(getMockAppTaskLayoutResId()); mFakeTaskView.animate().alpha(1).setListener( AnimatorListeners.forSuccessCallback(() -> mFakeTaskView.animate().cancel())); mFakePreviousTaskView.setBackground(AppCompatResources.getDrawable( diff --git a/res/drawable/gesture_tutorial_motion_overview_light_mode.xml b/res/drawable/gesture_tutorial_motion_overview_light_mode.xml deleted file mode 100644 index 75887c9352..0000000000 --- a/res/drawable/gesture_tutorial_motion_overview_light_mode.xml +++ /dev/null @@ -1,1587 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/res/values/colors.xml b/res/values/colors.xml index cc5c5a39d3..5020127440 100644 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -36,15 +36,6 @@ #E0E0E0 - #A0C2F9 - #6DA1FF - #000000 - #f9f9f9 - - #3C4043 - #FF000000 - #B7F29F - #FFF #F1F3F4 #E0E0E0