Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7f48b0aa authored by Zak Cohen's avatar Zak Cohen
Browse files

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
parent 0199fa46
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -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);
        }
    }

+1 −1
Original line number Diff line number Diff line
@@ -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();