From 7f48b0aa34f7ffec165b7eebb13b58790ac1c1c6 Mon Sep 17 00:00:00 2001 From: Zak Cohen Date: Wed, 29 Apr 2020 17:14:35 -0700 Subject: [PATCH] Overview - position the modal task in the correct place. video of new behavoir https://drive.google.com/a/google.com/file/d/1vFTtjjpwamj5H7dhmB1-5JSFS6fv6vMw/view?usp=sharing Test: local Bug: 155205932 Change-Id: I7fe79c848af92013587de32a777645cc472ae910 --- .../com/android/quickstep/views/RecentsView.java | 14 ++++++++++++++ .../BaseRecentsViewStateController.java | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java index 411f057bc6..955cf5a1a8 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java @@ -214,6 +214,7 @@ public abstract class RecentsView extends PagedView impl protected final Rect mTempRect = new Rect(); protected final RectF mTempRectF = new RectF(); private final PointF mTempPointF = new PointF(); + private final float[] mTempFloatPoint = new float[2]; private static final int DISMISS_TASK_DURATION = 300; private static final int ADDITION_TASK_DURATION = 200; @@ -1651,6 +1652,7 @@ public abstract class RecentsView extends PagedView impl mTempRect, mActivity.getDeviceProfile(), mTempPointF); setPivotX(mTempPointF.x); setPivotY(mTempPointF.y); + setTaskModalness(mTaskModalness); updatePageOffsets(); } @@ -2131,6 +2133,18 @@ public abstract class RecentsView extends PagedView impl updatePageOffsets(); if (getCurrentPageTaskView() != null) { getCurrentPageTaskView().setModalness(modalness); + TaskView tv = getCurrentPageTaskView(); + + // Move the task view up as it scales... + // ...the icon on taskview is hidden in modal state, so consider the top of the task + mTempFloatPoint[0] = 0; + mTempFloatPoint[1] = tv.getTop() + mTaskTopMargin; + // ...find the top after the transformation + getMatrix().mapPoints(mTempFloatPoint); + + // ...make it match the top inset + float calcOffset = (mInsets.top - mTempFloatPoint[1]) * mTaskModalness; + tv.setTranslationY(calcOffset); } } diff --git a/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java b/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java index ac50d6db8a..47fff5ee32 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java @@ -107,7 +107,7 @@ public abstract class BaseRecentsViewStateController setter.setFloat( mRecentsView, getTaskModalnessProperty(), toState.getOverviewModalness(), - config.getInterpolator(ANIM_OVERVIEW_MODAL, AGGRESSIVE_EASE_IN_OUT)); + config.getInterpolator(ANIM_OVERVIEW_MODAL, LINEAR)); } abstract FloatProperty getTaskModalnessProperty();