2D Recents: Fix issue with undocking only one task

am: 244bac6c8b

Change-Id: I3038a85bb5b351a4a753fa9fd31a205c1dd1f2aa
This commit is contained in:
Jiaquan He
2017-01-18 22:10:35 +00:00
committed by android-build-merger

View File

@@ -159,6 +159,10 @@ public class TaskGridLayoutAlgorithm {
*/ */
public TaskViewTransform getTransform(int taskIndex, int taskCount, public TaskViewTransform getTransform(int taskIndex, int taskCount,
TaskViewTransform transformOut, TaskStackLayoutAlgorithm stackLayout) { TaskViewTransform transformOut, TaskStackLayoutAlgorithm stackLayout) {
if (taskCount == 0) {
transformOut.reset();
return transformOut;
}
TaskGridRectInfo gridInfo = mTaskGridRectInfoList[taskCount - 1]; TaskGridRectInfo gridInfo = mTaskGridRectInfoList[taskCount - 1];
mTaskGridRect.set(gridInfo.size); mTaskGridRect.set(gridInfo.size);
@@ -174,7 +178,7 @@ public class TaskGridLayoutAlgorithm {
// We also need to invert the index in order to display the most recent tasks first. // We also need to invert the index in order to display the most recent tasks first.
int taskLayoutIndex = taskCount - taskIndex - 1; int taskLayoutIndex = taskCount - taskIndex - 1;
boolean isTaskViewVisible = (taskLayoutIndex < MAX_LAYOUT_TASK_COUNT); boolean isTaskViewVisible = taskLayoutIndex < MAX_LAYOUT_TASK_COUNT;
// Fill out the transform // Fill out the transform
transformOut.scale = 1f; transformOut.scale = 1f;