diff --git a/quickstep/src/com/android/quickstep/interaction/HomeGestureTutorialController.java b/quickstep/src/com/android/quickstep/interaction/HomeGestureTutorialController.java index 11c9e373eb..0497f0a200 100644 --- a/quickstep/src/com/android/quickstep/interaction/HomeGestureTutorialController.java +++ b/quickstep/src/com/android/quickstep/interaction/HomeGestureTutorialController.java @@ -106,6 +106,7 @@ final class HomeGestureTutorialController extends SwipeUpGestureTutorialControll case BACK_CANCELLED_FROM_LEFT: case BACK_CANCELLED_FROM_RIGHT: case BACK_NOT_STARTED_TOO_FAR_FROM_EDGE: + resetTaskView(); showFeedback(R.string.home_gesture_feedback_swipe_too_far_from_edge); break; } @@ -135,6 +136,7 @@ final class HomeGestureTutorialController extends SwipeUpGestureTutorialControll } case HOME_NOT_STARTED_TOO_FAR_FROM_EDGE: case OVERVIEW_NOT_STARTED_TOO_FAR_FROM_EDGE: + resetTaskView(); showFeedback(R.string.home_gesture_feedback_swipe_too_far_from_edge); break; case OVERVIEW_GESTURE_COMPLETED: diff --git a/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialController.java b/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialController.java index dfbcf4d14a..4a0512e636 100644 --- a/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialController.java +++ b/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialController.java @@ -112,6 +112,7 @@ final class OverviewGestureTutorialController extends SwipeUpGestureTutorialCont case BACK_CANCELLED_FROM_LEFT: case BACK_CANCELLED_FROM_RIGHT: case BACK_NOT_STARTED_TOO_FAR_FROM_EDGE: + resetTaskView(); showFeedback(R.string.overview_gesture_feedback_swipe_too_far_from_edge); break; } @@ -142,6 +143,7 @@ final class OverviewGestureTutorialController extends SwipeUpGestureTutorialCont } case HOME_NOT_STARTED_TOO_FAR_FROM_EDGE: case OVERVIEW_NOT_STARTED_TOO_FAR_FROM_EDGE: + resetTaskView(); showFeedback(R.string.overview_gesture_feedback_swipe_too_far_from_edge); break; case OVERVIEW_GESTURE_COMPLETED: diff --git a/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java b/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java index a8af05e7d8..6d29cb6074 100644 --- a/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java +++ b/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java @@ -61,7 +61,7 @@ import com.android.quickstep.util.TransformParams; @TargetApi(Build.VERSION_CODES.R) abstract class SwipeUpGestureTutorialController extends TutorialController { - private static final int FAKE_PREVIOUS_TASK_MARGIN = Utilities.dpToPx(12); + private static final int FAKE_PREVIOUS_TASK_MARGIN = Utilities.dpToPx(24); protected static final long TASK_VIEW_END_ANIMATION_DURATION_MILLIS = 300; private static final long HOME_SWIPE_ANIMATION_DURATION_MILLIS = 625; @@ -77,23 +77,7 @@ abstract class SwipeUpGestureTutorialController extends TutorialController { private final AnimatorListenerAdapter mResetTaskView = new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { - mFakeHotseatView.setVisibility(View.INVISIBLE); - mFakeIconView.setVisibility(View.INVISIBLE); - if (mTutorialFragment.getActivity() != null) { - int height = mTutorialFragment.getRootView().getFullscreenHeight(); - int width = mTutorialFragment.getRootView().getWidth(); - mFakeTaskViewRect.set(0, 0, width, height); - } - mFakeTaskViewRadius = 0; - mFakeTaskView.invalidateOutline(); - mFakeTaskView.setVisibility(View.VISIBLE); - mFakeTaskView.setAlpha(1); - mFakePreviousTaskView.setVisibility(View.INVISIBLE); - mFakePreviousTaskView.setAlpha(1); - mFakePreviousTaskView.setToSingleRowLayout(false); - mShowTasks = false; - mShowPreviousTasks = false; - mRunningWindowAnim = null; + resetTaskView(); } }; @@ -137,6 +121,26 @@ abstract class SwipeUpGestureTutorialController extends TutorialController { mRunningWindowAnim = null; } + void resetTaskView() { + mFakeHotseatView.setVisibility(View.INVISIBLE); + mFakeIconView.setVisibility(View.INVISIBLE); + if (mTutorialFragment.getActivity() != null) { + int height = mTutorialFragment.getRootView().getFullscreenHeight(); + int width = mTutorialFragment.getRootView().getWidth(); + mFakeTaskViewRect.set(0, 0, width, height); + } + mFakeTaskViewRadius = 0; + mFakeTaskView.invalidateOutline(); + mFakeTaskView.setVisibility(View.VISIBLE); + mFakeTaskView.setAlpha(1); + mFakePreviousTaskView.setVisibility(View.INVISIBLE); + mFakePreviousTaskView.setAlpha(1); + mFakePreviousTaskView.setToSingleRowLayout(false); + mShowTasks = false; + mShowPreviousTasks = false; + mRunningWindowAnim = null; + } + /** Fades the task view, optionally after animating to a fake Overview. */ void fadeOutFakeTaskView(boolean toOverviewFirst, boolean reset, @Nullable Runnable onEndRunnable) {