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

Commit 05b6d041 authored by Winson Chung's avatar Winson Chung Committed by Android Git Automerger
Browse files

am f67f7277: Fixing animation when dismissing certain tasks.

* commit 'f67f72774383b35d0661f60d933c1a9468bac296':
  Fixing animation when dismissing certain tasks.
parents d496790e d6c3db5e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -296,8 +296,8 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
                        if (transform.t < 0) {
                            mTmpTransform = mStackAlgorithm.getStackTransform(tasks.get(0), stackScroll, mTmpTransform);
                        } else {
                            mTmpTransform = mStackAlgorithm.getStackTransform(tasks.get(Math.min(tasks.size() - 1, visibleRange[0] + 1)),
                                    stackScroll, mTmpTransform);
                            int nextTaskStackScroll = mStackAlgorithm.getStackScrollForTaskIndex(task, 1);
                            mStackAlgorithm.getStackTransform(nextTaskStackScroll, stackScroll, mTmpTransform);
                        }
                        tv.updateViewPropertiesToTaskTransform(mTmpTransform, 0);
                    }
+15 −3
Original line number Diff line number Diff line
@@ -103,12 +103,16 @@ public class TaskStackViewLayoutAlgorithm {
            transformOut.reset();
            return transformOut;
        }
        return getStackTransform(getStackScrollForTaskIndex(task), stackScroll, transformOut);
    }

    /** Update/get the transform */
    public TaskViewTransform getStackTransform(int taskStackScroll, int stackScroll, TaskViewTransform transformOut) {
        // Map the items to an continuous position relative to the specified scroll
        int numPeekCards = StackPeekNumCards;
        float overlapHeight = StackOverlapPct * mTaskRect.height();
        float peekHeight = StackPeekHeightPct * mStackRect.height();
        float t = (getStackScrollForTaskIndex(task) - stackScroll) / overlapHeight;
        float t = (taskStackScroll - stackScroll) / overlapHeight;
        float boundedT = Math.max(t, -(numPeekCards + 1));

        // Set the scale relative to its position
@@ -168,6 +172,14 @@ public class TaskStackViewLayoutAlgorithm {
        return mTaskOffsetMap.get(t.key);
    }

    /**
     * Returns the scroll to such that the task transform at that task + index will have t=0.
     * (If the scroll is not bounded)
     */
    int getStackScrollForTaskIndex(Task t, int relativeIndexOffset) {
        return mTaskOffsetMap.get(t.key) + (int) (relativeIndexOffset * getTaskOverlapHeight());
    }

    /**
     * Updates the cache of tasks to offsets.
     */