diff --git a/quickstep/res/drawable/default_sandbox_mock_launcher.xml b/quickstep/res/drawable/default_sandbox_mock_launcher.xml
deleted file mode 100644
index 38fbcf09b6..0000000000
--- a/quickstep/res/drawable/default_sandbox_mock_launcher.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
diff --git a/quickstep/res/layout/gesture_tutorial_foldable_mock_conversation.xml b/quickstep/res/layout/gesture_tutorial_foldable_mock_conversation.xml
new file mode 100644
index 0000000000..34bd4e2845
--- /dev/null
+++ b/quickstep/res/layout/gesture_tutorial_foldable_mock_conversation.xml
@@ -0,0 +1,239 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/quickstep/res/layout/gesture_tutorial_foldable_mock_conversation_list.xml b/quickstep/res/layout/gesture_tutorial_foldable_mock_conversation_list.xml
new file mode 100644
index 0000000000..0309cc37cc
--- /dev/null
+++ b/quickstep/res/layout/gesture_tutorial_foldable_mock_conversation_list.xml
@@ -0,0 +1,396 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/quickstep/res/layout/gesture_tutorial_foldable_mock_hotseat.xml b/quickstep/res/layout/gesture_tutorial_foldable_mock_hotseat.xml
new file mode 100644
index 0000000000..5612666b69
--- /dev/null
+++ b/quickstep/res/layout/gesture_tutorial_foldable_mock_hotseat.xml
@@ -0,0 +1,108 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/quickstep/res/layout/gesture_tutorial_foldable_mock_webpage.xml b/quickstep/res/layout/gesture_tutorial_foldable_mock_webpage.xml
new file mode 100644
index 0000000000..67e9b02b3d
--- /dev/null
+++ b/quickstep/res/layout/gesture_tutorial_foldable_mock_webpage.xml
@@ -0,0 +1,275 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/quickstep/res/layout/gesture_tutorial_fragment.xml b/quickstep/res/layout/gesture_tutorial_fragment.xml
index 0f0119071e..41d0a1d38f 100644
--- a/quickstep/res/layout/gesture_tutorial_fragment.xml
+++ b/quickstep/res/layout/gesture_tutorial_fragment.xml
@@ -25,13 +25,12 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
-
+ android:layout_alignParentBottom="true"/>
@@ -128,8 +127,6 @@
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
- android:layout_marginStart="@dimen/gesture_tutorial_feedback_margin_start_end"
- android:layout_marginEnd="@dimen/gesture_tutorial_feedback_margin_start_end"
android:layout_marginTop="24dp"
android:paddingTop="24dp"
android:paddingBottom="16dp"
diff --git a/quickstep/res/layout/gesture_tutorial_mock_conversation.xml b/quickstep/res/layout/gesture_tutorial_mock_conversation.xml
index 9951663d3f..e8d5d79a58 100644
--- a/quickstep/res/layout/gesture_tutorial_mock_conversation.xml
+++ b/quickstep/res/layout/gesture_tutorial_mock_conversation.xml
@@ -94,7 +94,7 @@
@@ -83,7 +83,7 @@
android:id="@+id/conversation_line_1"
android:layout_width="0dp"
android:layout_height="18dp"
- android:layout_marginStart="20dp"
+ android:layout_marginStart="@dimen/gesture_tutorial_conversation_line_padding_start"
android:layout_marginEnd="217dp"
app:cardElevation="0dp"
@@ -99,7 +99,7 @@
android:id="@+id/conversation_line_2"
android:layout_width="0dp"
android:layout_height="16dp"
- android:layout_marginStart="20dp"
+ android:layout_marginStart="@dimen/gesture_tutorial_conversation_line_padding_start"
android:layout_marginEnd="142dp"
android:layout_marginTop="4dp"
@@ -113,12 +113,12 @@
@@ -127,7 +127,7 @@
android:id="@+id/conversation_line_3"
android:layout_width="0dp"
android:layout_height="18dp"
- android:layout_marginStart="20dp"
+ android:layout_marginStart="@dimen/gesture_tutorial_conversation_line_padding_start"
android:layout_marginEnd="190dp"
app:cardElevation="0dp"
@@ -143,7 +143,7 @@
android:id="@+id/conversation_line_4"
android:layout_width="0dp"
android:layout_height="16dp"
- android:layout_marginStart="20dp"
+ android:layout_marginStart="@dimen/gesture_tutorial_conversation_line_padding_start"
android:layout_marginEnd="171dp"
android:layout_marginTop="4dp"
@@ -157,12 +157,12 @@
@@ -171,7 +171,7 @@
android:id="@+id/conversation_line_5"
android:layout_width="0dp"
android:layout_height="18dp"
- android:layout_marginStart="20dp"
+ android:layout_marginStart="@dimen/gesture_tutorial_conversation_line_padding_start"
android:layout_marginEnd="198dp"
app:cardElevation="0dp"
@@ -187,7 +187,7 @@
android:id="@+id/conversation_line_6"
android:layout_width="0dp"
android:layout_height="16dp"
- android:layout_marginStart="20dp"
+ android:layout_marginStart="@dimen/gesture_tutorial_conversation_line_padding_start"
android:layout_marginEnd="79dp"
android:layout_marginTop="4dp"
@@ -201,12 +201,12 @@
@@ -215,7 +215,7 @@
android:id="@+id/conversation_line_7"
android:layout_width="0dp"
android:layout_height="18dp"
- android:layout_marginStart="20dp"
+ android:layout_marginStart="@dimen/gesture_tutorial_conversation_line_padding_start"
android:layout_marginEnd="174dp"
app:cardElevation="0dp"
@@ -231,7 +231,7 @@
android:id="@+id/conversation_line_8"
android:layout_width="0dp"
android:layout_height="16dp"
- android:layout_marginStart="20dp"
+ android:layout_marginStart="@dimen/gesture_tutorial_conversation_line_padding_start"
android:layout_marginEnd="117dp"
android:layout_marginTop="4dp"
@@ -245,12 +245,12 @@
@@ -259,7 +259,7 @@
android:id="@+id/conversation_line_9"
android:layout_width="0dp"
android:layout_height="18dp"
- android:layout_marginStart="20dp"
+ android:layout_marginStart="@dimen/gesture_tutorial_conversation_line_padding_start"
android:layout_marginEnd="244dp"
app:cardElevation="0dp"
@@ -275,7 +275,7 @@
android:id="@+id/conversation_line_10"
android:layout_width="0dp"
android:layout_height="16dp"
- android:layout_marginStart="20dp"
+ android:layout_marginStart="@dimen/gesture_tutorial_conversation_line_padding_start"
android:layout_marginEnd="143dp"
android:layout_marginTop="4dp"
@@ -289,12 +289,12 @@
@@ -303,7 +303,7 @@
android:id="@+id/conversation_line_11"
android:layout_width="0dp"
android:layout_height="18dp"
- android:layout_marginStart="20dp"
+ android:layout_marginStart="@dimen/gesture_tutorial_conversation_line_padding_start"
android:layout_marginEnd="177dp"
app:cardElevation="0dp"
@@ -319,7 +319,7 @@
android:id="@+id/conversation_line_12"
android:layout_width="0dp"
android:layout_height="16dp"
- android:layout_marginStart="20dp"
+ android:layout_marginStart="@dimen/gesture_tutorial_conversation_line_padding_start"
android:layout_marginEnd="117dp"
android:layout_marginTop="4dp"
@@ -333,12 +333,12 @@
@@ -347,7 +347,7 @@
android:id="@+id/conversation_line_13"
android:layout_width="0dp"
android:layout_height="18dp"
- android:layout_marginStart="20dp"
+ android:layout_marginStart="@dimen/gesture_tutorial_conversation_line_padding_start"
android:layout_marginEnd="189dp"
app:cardElevation="0dp"
@@ -363,7 +363,7 @@
android:id="@+id/conversation_line_14"
android:layout_width="0dp"
android:layout_height="16dp"
- android:layout_marginStart="20dp"
+ android:layout_marginStart="@dimen/gesture_tutorial_conversation_line_padding_start"
android:layout_marginEnd="166dp"
android:layout_marginTop="4dp"
diff --git a/quickstep/res/layout/gesture_tutorial_mock_hotseat.xml b/quickstep/res/layout/gesture_tutorial_mock_hotseat.xml
new file mode 100644
index 0000000000..b3e86cf4de
--- /dev/null
+++ b/quickstep/res/layout/gesture_tutorial_mock_hotseat.xml
@@ -0,0 +1,76 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ 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
index ab00a113b4..bb20968d8f 100644
--- a/quickstep/res/layout/gesture_tutorial_mock_webpage.xml
+++ b/quickstep/res/layout/gesture_tutorial_mock_webpage.xml
@@ -64,7 +64,6 @@
android:layout_marginTop="22dp"
android:layout_marginBottom="22dp"
android:layout_marginStart="24dp"
- android:layout_marginEnd="344dp"
app:cardElevation="0dp"
app:cardCornerRadius="8dp"
@@ -72,8 +71,7 @@
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintEnd_toEndOf="parent"/>
+ app:layout_constraintStart_toStartOf="parent"/>
@@ -164,10 +161,10 @@
android:layout_height="12dp"
android:background="@color/mock_webpage_page_text"
android:layout_marginStart="11dp"
- android:layout_marginTop="8dp"
+ android:layout_marginTop="@dimen/gesture_tutorial_webpage_small_margin_top"
app:cardElevation="0dp"
- app:cardCornerRadius="4dp"
+ app:cardCornerRadius="@dimen/gesture_tutorial_webpage_small_corner_radius"
app:cardBackgroundColor="@color/mock_webpage_page_text"
app:layout_constraintTop_toBottomOf="@id/mock_line_3"
app:layout_constraintStart_toEndOf="@id/mock_button"/>
@@ -176,11 +173,11 @@
android:id="@+id/mock_block"
android:layout_width="0dp"
android:layout_height="240dp"
- android:layout_marginTop="24dp"
+ android:layout_marginTop="@dimen/gesture_tutorial_webpage_large_margin_top"
android:layout_marginEnd="24dp"
app:cardElevation="0dp"
- app:cardCornerRadius="22dp"
+ app:cardCornerRadius="@dimen/gesture_tutorial_webpage_large_corner_radius"
app:cardBackgroundColor="@color/mock_webpage_page_text"
app:layout_constraintTop_toBottomOf="@id/mock_button"
app:layout_constraintStart_toStartOf="parent"
@@ -189,12 +186,12 @@
#FF000000
#B7F29F
+
+ #8AB4F8
+ #F28B82
+ #FDD663
+ #81C995
+ #3C4043
+
#f1f3f4
#e8eaed
diff --git a/quickstep/res/values/dimens.xml b/quickstep/res/values/dimens.xml
index e903377101..02479bfa0d 100644
--- a/quickstep/res/values/dimens.xml
+++ b/quickstep/res/values/dimens.xml
@@ -117,13 +117,44 @@
136dp
- 40dp
- 16dp
24dp
- 18dp
+ 140dp
72dp
18dp
+
+ 44dp
+ 100dp
+ 36dp
+ 32dp
+ 4dp
+ 26dp
+ 18dp
+ 126dp
+
+
+ 56dp
+ 100dp
+ 28dp
+ 20dp
+
+
+ 60dp
+ 100dp
+ 50dp
+ 100dp
+ 36dp
+
+
+ 32dp
+ 24dp
+ 8dp
+ 22dp
+ 8dp
+ 4dp
+ 36dp
+ 22dp
+
40dp
24dp
diff --git a/quickstep/src/com/android/quickstep/interaction/BackGestureTutorialController.java b/quickstep/src/com/android/quickstep/interaction/BackGestureTutorialController.java
index 30f900873e..fb6cd8a513 100644
--- a/quickstep/src/com/android/quickstep/interaction/BackGestureTutorialController.java
+++ b/quickstep/src/com/android/quickstep/interaction/BackGestureTutorialController.java
@@ -49,12 +49,16 @@ final class BackGestureTutorialController extends TutorialController {
@LayoutRes
int getMockAppTaskCurrentPageLayoutResId() {
- return R.layout.gesture_tutorial_mock_conversation;
+ return mTutorialFragment.isLargeScreen()
+ ? R.layout.gesture_tutorial_foldable_mock_conversation
+ : R.layout.gesture_tutorial_mock_conversation;
}
@LayoutRes
int getMockAppTaskPreviousPageLayoutResId() {
- return R.layout.gesture_tutorial_mock_conversation_list;
+ return mTutorialFragment.isLargeScreen()
+ ? R.layout.gesture_tutorial_foldable_mock_conversation_list
+ : R.layout.gesture_tutorial_mock_conversation_list;
}
@Override
diff --git a/quickstep/src/com/android/quickstep/interaction/HomeGestureTutorialController.java b/quickstep/src/com/android/quickstep/interaction/HomeGestureTutorialController.java
index 3ad84f0cce..a45f27383b 100644
--- a/quickstep/src/com/android/quickstep/interaction/HomeGestureTutorialController.java
+++ b/quickstep/src/com/android/quickstep/interaction/HomeGestureTutorialController.java
@@ -43,7 +43,9 @@ final class HomeGestureTutorialController extends SwipeUpGestureTutorialControll
@Override
protected int getMockAppTaskLayoutResId() {
- return R.layout.gesture_tutorial_mock_webpage;
+ return mTutorialFragment.isLargeScreen()
+ ? R.layout.gesture_tutorial_foldable_mock_webpage
+ : R.layout.gesture_tutorial_mock_webpage;
}
@Override
diff --git a/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialController.java b/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialController.java
index 9d60e1bab6..24ef1fab4d 100644
--- a/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialController.java
+++ b/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialController.java
@@ -53,7 +53,9 @@ final class OverviewGestureTutorialController extends SwipeUpGestureTutorialCont
@Override
protected int getMockAppTaskLayoutResId() {
- return R.layout.gesture_tutorial_mock_conversation_list;
+ return mTutorialFragment.isLargeScreen()
+ ? R.layout.gesture_tutorial_foldable_mock_conversation_list
+ : 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 968412bedc..57a76ca041 100644
--- a/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialFragment.java
+++ b/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialFragment.java
@@ -57,17 +57,6 @@ public class OverviewGestureTutorialFragment extends TutorialFragment {
}
});
- Animator swipeAnimator =
- controller.createFingerDotOverviewSwipeAnimator(fingerDotStartTranslationY);
- swipeAnimator.addListener(new AnimatorListenerAdapter() {
- @Override
- public void onAnimationEnd(Animator animation) {
- super.onAnimationEnd(animation);
- mFakePreviousTaskView.setVisibility(View.VISIBLE);
- controller.onMotionPaused(true /*arbitrary value*/);
- }
- });
-
AnimatorSet fingerDotDisappearanceAnimator =
controller.createFingerDotDisappearanceAnimatorSet();
fingerDotDisappearanceAnimator.addListener(new AnimatorListenerAdapter() {
@@ -89,7 +78,7 @@ public class OverviewGestureTutorialFragment extends TutorialFragment {
ArrayList animators = new ArrayList<>();
animators.add(fingerDotAppearanceAnimator);
- animators.add(swipeAnimator);
+ animators.add(controller.createFingerDotOverviewSwipeAnimator(fingerDotStartTranslationY));
animators.add(controller.createAnimationPause());
animators.add(fingerDotDisappearanceAnimator);
animators.add(animationPause);
diff --git a/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java b/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java
index 0c7b35b1c6..a923519a75 100644
--- a/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java
+++ b/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java
@@ -320,8 +320,8 @@ abstract class SwipeUpGestureTutorialController extends TutorialController {
@Override
public RectF getWindowTargetRect() {
int fakeHomeIconSizePx = Utilities.dpToPx(60);
- int fakeHomeIconLeft = mFakeHotseatView.getLeft();
- int fakeHomeIconTop = mFakeHotseatView.getTop();
+ int fakeHomeIconLeft = getHotseatIconLeft();
+ int fakeHomeIconTop = getHotseatIconTop();
return new RectF(fakeHomeIconLeft, fakeHomeIconTop,
fakeHomeIconLeft + fakeHomeIconSizePx,
fakeHomeIconTop + fakeHomeIconSizePx);
@@ -374,8 +374,19 @@ abstract class SwipeUpGestureTutorialController extends TutorialController {
}
protected Animator createFingerDotOverviewSwipeAnimator(float fingerDotStartTranslationY) {
- return createFingerDotSwipeUpAnimator(fingerDotStartTranslationY)
+ Animator overviewSwipeAnimator = createFingerDotSwipeUpAnimator(fingerDotStartTranslationY)
.setDuration(OVERVIEW_SWIPE_ANIMATION_DURATION_MILLIS);
+
+ overviewSwipeAnimator.addListener(new AnimatorListenerAdapter() {
+ @Override
+ public void onAnimationEnd(Animator animation) {
+ super.onAnimationEnd(animation);
+ mFakePreviousTaskView.setVisibility(View.VISIBLE);
+ onMotionPaused(true /*arbitrary value*/);
+ }
+ });
+
+ return overviewSwipeAnimator;
}
diff --git a/quickstep/src/com/android/quickstep/interaction/TutorialController.java b/quickstep/src/com/android/quickstep/interaction/TutorialController.java
index 94fb55621e..9c1ff4dbd3 100644
--- a/quickstep/src/com/android/quickstep/interaction/TutorialController.java
+++ b/quickstep/src/com/android/quickstep/interaction/TutorialController.java
@@ -85,7 +85,8 @@ abstract class TutorialController implements BackGestureAttemptCallback,
final TextView mFeedbackTitleView;
final ImageView mEdgeGestureVideoView;
final RelativeLayout mFakeLauncherView;
- final ImageView mFakeHotseatView;
+ final FrameLayout mFakeHotseatView;
+ @Nullable View mHotseatIconView;
final ClipIconView mFakeIconView;
final FrameLayout mFakeTaskView;
final AnimatedTaskView mFakePreviousTaskView;
@@ -164,13 +165,25 @@ abstract class TutorialController implements BackGestureAttemptCallback,
}
}
+ public int getHotseatIconTop() {
+ return mHotseatIconView == null
+ ? 0 : mFakeHotseatView.getTop() + mHotseatIconView.getTop();
+ }
+
+ public int getHotseatIconLeft() {
+ return mHotseatIconView == null
+ ? 0 : mFakeHotseatView.getLeft() + mHotseatIconView.getLeft();
+ }
+
void setTutorialType(TutorialType tutorialType) {
mTutorialType = tutorialType;
}
- @DrawableRes
+ @LayoutRes
protected int getMockHotseatResId() {
- return R.drawable.default_sandbox_mock_launcher;
+ return mTutorialFragment.isLargeScreen()
+ ? R.layout.gesture_tutorial_foldable_mock_hotseat
+ : R.layout.gesture_tutorial_mock_hotseat;
}
@LayoutRes
@@ -384,6 +397,7 @@ abstract class TutorialController implements BackGestureAttemptCallback,
hideActionButton();
updateSubtext();
updateDrawables();
+ updateLayout();
mGestureCompleted = false;
if (mFakeHotseatView != null) {
@@ -416,10 +430,14 @@ abstract class TutorialController implements BackGestureAttemptCallback,
}
void updateFakeAppTaskViewLayout(@LayoutRes int mockAppTaskLayoutResId) {
- mFakeTaskView.removeAllViews();
- if (mockAppTaskLayoutResId != NO_ID) {
- mFakeTaskView.addView(
- inflate(mContext, mockAppTaskLayoutResId, null),
+ updateFakeViewLayout(mFakeTaskView, mockAppTaskLayoutResId);
+ }
+
+ void updateFakeViewLayout(ViewGroup view, @LayoutRes int mockLayoutResId) {
+ view.removeAllViews();
+ if (mockLayoutResId != NO_ID) {
+ view.addView(
+ inflate(mContext, mockLayoutResId, null),
new FrameLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT));
@@ -438,9 +456,9 @@ abstract class TutorialController implements BackGestureAttemptCallback,
mTutorialFragment.updateFeedbackAnimation();
mFakeLauncherView.setBackgroundColor(
mContext.getColor(R.color.gesture_tutorial_fake_wallpaper_color));
- mFakeHotseatView.setImageDrawable(AppCompatResources.getDrawable(
- mContext, getMockHotseatResId()));
- updateFakeAppTaskViewLayout(getMockAppTaskLayoutResId());
+ 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(
@@ -450,6 +468,21 @@ abstract class TutorialController implements BackGestureAttemptCallback,
}
}
+ private void updateLayout() {
+ if (mContext != null) {
+ RelativeLayout.LayoutParams feedbackLayoutParams =
+ (RelativeLayout.LayoutParams) mFeedbackView.getLayoutParams();
+ feedbackLayoutParams.setMarginStart(mContext.getResources().getDimensionPixelSize(
+ mTutorialFragment.isLargeScreen()
+ ? R.dimen.gesture_tutorial_foldable_feedback_margin_start_end
+ : R.dimen.gesture_tutorial_feedback_margin_start_end));
+ feedbackLayoutParams.setMarginEnd(mContext.getResources().getDimensionPixelSize(
+ mTutorialFragment.isLargeScreen()
+ ? R.dimen.gesture_tutorial_foldable_feedback_margin_start_end
+ : R.dimen.gesture_tutorial_feedback_margin_start_end));
+ }
+ }
+
private AlertDialog createSkipTutorialDialog() {
if (mContext instanceof GestureSandboxActivity) {
GestureSandboxActivity sandboxActivity = (GestureSandboxActivity) mContext;