Fixing regression when animating in new views after dismissing task.

- In the old stack, the range of stack task progress was 0..1, but now
  it needs to be offset by the stack range.

Change-Id: I21cb5c7c8c3cc3648867626a516de9ab01e704c8
This commit is contained in:
Winson
2015-12-03 11:35:25 -08:00
committed by Winson Chung
parent 1684f521d8
commit 0e0d85c23c
2 changed files with 12 additions and 2 deletions

View File

@@ -504,6 +504,15 @@ public class TaskStackLayoutAlgorithm {
return 0f;
}
/**
* Returns the task progress that would put the task just off the front of the stack.
*/
public float getStackFrontTaskProgress(float stackScroll) {
float max = mUnfocusedRange.relativeMax +
mFocusState * (mFocusedRange.relativeMax - mUnfocusedRange.relativeMax);
return stackScroll + max;
}
/**
* Computes the maximum number of visible tasks and thumbnails when the scroll is at the initial
* stack scroll. Requires that update() is called first.

View File

@@ -517,8 +517,9 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
} else {
if (!hasStackFrontTransform) {
hasStackFrontTransform = true;
mLayoutAlgorithm.getStackTransform(1f, 0f, mTmpStackFrontTransform,
null);
mLayoutAlgorithm.getStackTransform(
mLayoutAlgorithm.getStackFrontTaskProgress(0f), 0f,
mTmpStackFrontTransform, null);
}
tv.updateViewPropertiesToTaskTransform(mTmpStackFrontTransform, 0, 0,
mFastOutSlowInInterpolator, mRequestUpdateClippingListener);