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
This commit is contained in:
Zak Cohen
2020-04-29 17:14:35 -07:00
parent 0199fa46de
commit 7f48b0aa34
2 changed files with 15 additions and 1 deletions
@@ -214,6 +214,7 @@ public abstract class RecentsView<T extends BaseActivity> 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<T extends BaseActivity> extends PagedView impl
mTempRect, mActivity.getDeviceProfile(), mTempPointF);
setPivotX(mTempPointF.x);
setPivotY(mTempPointF.y);
setTaskModalness(mTaskModalness);
updatePageOffsets();
}
@@ -2131,6 +2133,18 @@ public abstract class RecentsView<T extends BaseActivity> 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);
}
}
@@ -107,7 +107,7 @@ public abstract class BaseRecentsViewStateController<T extends RecentsView>
setter.setFloat(
mRecentsView, getTaskModalnessProperty(),
toState.getOverviewModalness(),
config.getInterpolator(ANIM_OVERVIEW_MODAL, AGGRESSIVE_EASE_IN_OUT));
config.getInterpolator(ANIM_OVERVIEW_MODAL, LINEAR));
}
abstract FloatProperty getTaskModalnessProperty();