From 84376f305b338dbff4babe0b296a7d26e5cc71c2 Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Mon, 11 May 2020 13:11:59 -0700 Subject: [PATCH] Fixing current task not overshooting on swipe-up in overview > also fixing flicker during swipe-up when scroll is applied before recents has been initialized Bug: 154761552 Change-Id: I45c2b6801b8b87097c2816e26a234bab41b72ed4 --- .../android/quickstep/BaseSwipeUpHandler.java | 21 ++++++------------- .../quickstep/LauncherSwipeHandler.java | 3 ++- .../android/quickstep/views/RecentsView.java | 13 +++--------- 3 files changed, 11 insertions(+), 26 deletions(-) diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/BaseSwipeUpHandler.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/BaseSwipeUpHandler.java index f76b18b920..eb976c7f3a 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/BaseSwipeUpHandler.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/BaseSwipeUpHandler.java @@ -38,7 +38,6 @@ import android.graphics.RectF; import android.os.Build; import android.util.Pair; import android.view.MotionEvent; -import android.view.View; import android.view.animation.Interpolator; import androidx.annotation.NonNull; @@ -131,6 +130,8 @@ public abstract class BaseSwipeUpHandler mRecentsView.setRecentsAnimationTargets(mRecentsAnimationController, mRecentsAnimationTargets)); + mRecentsViewScrollLinked = true; } protected void startNewTask(Consumer resultCallback) { @@ -329,19 +331,6 @@ public abstract class BaseSwipeUpHandler extends PagedView impl } int count = getChildCount(); - TaskView runningTask = mRunningTaskId == -1 ? null : getTaskView(mRunningTaskId); + TaskView runningTask = mRunningTaskId == -1 || !mRunningTaskTileHidden + ? null : getTaskView(mRunningTaskId); int midPoint = runningTask == null ? -1 : indexOfChild(runningTask); int currentPage = getCurrentPage(); @@ -2066,14 +2067,6 @@ public abstract class RecentsView extends PagedView impl return getScrollForPage(getRunningTaskIndex()) - mOrientationHandler.getPrimaryScroll(this); } - /** - * @return How many pixels the running task is offset on the x-axis due to the current scrollX - * and parent scale. - */ - public float getScrollOffsetScaled() { - return getScrollOffset() * mOrientationHandler.getPrimaryScale(this); - } - public Consumer getEventDispatcher(float navbarRotation) { float degreesRotated; if (navbarRotation == 0) {