Loading packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java +2 −2 Original line number Diff line number Diff line Loading @@ -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); } Loading packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewLayoutAlgorithm.java +15 −3 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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. */ Loading Loading
packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java +2 −2 Original line number Diff line number Diff line Loading @@ -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); } Loading
packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewLayoutAlgorithm.java +15 −3 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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. */ Loading