diff --git a/quickstep/src/com/android/quickstep/TaskViewUtils.java b/quickstep/src/com/android/quickstep/TaskViewUtils.java index ae3cc50ac6..6addfe30f4 100644 --- a/quickstep/src/com/android/quickstep/TaskViewUtils.java +++ b/quickstep/src/com/android/quickstep/TaskViewUtils.java @@ -32,7 +32,6 @@ import static com.android.launcher3.QuickstepTransitionManager.SPLIT_LAUNCH_DURA import static com.android.launcher3.Utilities.getDescendantCoordRelativeToAncestor; import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.launcher3.anim.Interpolators.TOUCH_RESPONSE_INTERPOLATOR; -import static com.android.launcher3.anim.Interpolators.TOUCH_RESPONSE_INTERPOLATOR_ACCEL_DEACCEL; import static com.android.launcher3.anim.Interpolators.clampToProgress; import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE; import static com.android.launcher3.statehandlers.DepthController.DEPTH; @@ -193,7 +192,6 @@ public final class TaskViewUtils { boolean showAsGrid = dp.overviewShowAsGrid; boolean parallaxCenterAndAdjacentTask = taskIndex != recentsView.getCurrentPage() && !showAsGrid; - float gridTranslationSecondary = recentsView.getGridTranslationSecondary(taskIndex); int startScroll = recentsView.getScrollOffset(taskIndex); RemoteTargetHandle[] topMostSimulators = null; @@ -211,11 +209,9 @@ public final class TaskViewUtils { tvsLocal.fullScreenProgress.value = 0; tvsLocal.recentsViewScale.value = 1; - if (showAsGrid) { - tvsLocal.taskSecondaryTranslation.value = gridTranslationSecondary; - } tvsLocal.setScroll(startScroll); tvsLocal.setIsGridTask(v.isGridTask()); + tvsLocal.setGridTranslationY(v.getGridTranslationY()); // Fade in the task during the initial 20% of the animation out.addFloat(targetHandle.getTransformParams(), TransformParams.TARGET_ALPHA, 0, 1, @@ -230,10 +226,6 @@ public final class TaskViewUtils { out.setFloat(tvsLocal.recentsViewScale, AnimatedFloat.VALUE, tvsLocal.getFullScreenScale(), TOUCH_RESPONSE_INTERPOLATOR); - if (showAsGrid) { - out.setFloat(tvsLocal.taskSecondaryTranslation, AnimatedFloat.VALUE, 0, - TOUCH_RESPONSE_INTERPOLATOR_ACCEL_DEACCEL); - } out.setFloat(tvsLocal.recentsViewScroll, AnimatedFloat.VALUE, 0, TOUCH_RESPONSE_INTERPOLATOR); diff --git a/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java b/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java index 146d2355f1..7d396ba002 100644 --- a/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java +++ b/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java @@ -102,6 +102,7 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy { private StagedSplitBounds mStagedSplitBounds; private boolean mDrawsBelowRecents; private boolean mIsGridTask; + private float mGridTranslationY; public TaskViewSimulator(Context context, BaseActivityInterface sizeStrategy) { mContext = context; @@ -156,9 +157,15 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy { fullTaskSize = new Rect(mTaskRect); mOrientationState.getOrientationHandler() .setSplitTaskSwipeRect(mDp, mTaskRect, mStagedSplitBounds, mStagePosition); + if (mIsGridTask) { + mTaskRect.offset(0, (int) mGridTranslationY); + } } else { fullTaskSize = mTaskRect; } + if (mIsGridTask) { + fullTaskSize.offset(0, (int) mGridTranslationY); + } return mOrientationState.getFullScreenScaleAndPivot(fullTaskSize, mDp, mPivot); } @@ -217,6 +224,13 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy { mIsGridTask = isGridTask; } + /** + * Sets the y-translation when overview is in grid. + */ + public void setGridTranslationY(float gridTranslationY) { + mGridTranslationY = gridTranslationY; + } + /** * Adds animation for all the components corresponding to transition from an app to overview. */ @@ -320,14 +334,12 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy { mMatrix.postTranslate(insets.left, insets.top); mMatrix.postScale(scale, scale); - // Apply TaskView matrix: translate, scroll + // Apply TaskView matrix: taskRect, translate mMatrix.postTranslate(mTaskRect.left, mTaskRect.top); mOrientationState.getOrientationHandler().set(mMatrix, MATRIX_POST_TRANSLATE, taskPrimaryTranslation.value); mOrientationState.getOrientationHandler().setSecondary(mMatrix, MATRIX_POST_TRANSLATE, taskSecondaryTranslation.value); - mOrientationState.getOrientationHandler().set( - mMatrix, MATRIX_POST_TRANSLATE, recentsViewScroll.value); // Apply RecentsView matrix mMatrix.postScale(recentsViewScale.value, recentsViewScale.value, mPivot.x, mPivot.y); @@ -335,6 +347,8 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy { recentsViewSecondaryTranslation.value); mOrientationState.getOrientationHandler().set(mMatrix, MATRIX_POST_TRANSLATE, recentsViewPrimaryTranslation.value); + mOrientationState.getOrientationHandler().set( + mMatrix, MATRIX_POST_TRANSLATE, recentsViewScroll.value); applyWindowToHomeRotation(mMatrix); // Crop rect is the inverse of thumbnail matrix diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index 223ce1c556..586693cfa7 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -4654,20 +4654,6 @@ public abstract class RecentsView getEventDispatcher(float navbarRotation) { float degreesRotated; if (navbarRotation == 0) {