Fixing two small regressions in stack layout.

- Fixed issue with max scroll position being placed beyond the max
  scroll if the task height is larger than the stack height.
- Fixed issue with single task offsets being calculated incorrectly

Change-Id: I3cb1ecf2c13de7196bd68cd4f9d9f4f4736ed3ce
This commit is contained in:
Winson
2015-11-24 17:50:17 -08:00
committed by Winson Chung
parent 54fdfaa3b5
commit 7afe8c9002

View File

@@ -316,6 +316,7 @@ public class TaskStackLayoutAlgorithm {
Log.d(TAG, "\tmFreeformRect: " + mFreeformRect);
Log.d(TAG, "\tmFreeformStackRect: " + mFreeformStackRect);
Log.d(TAG, "\tmStackRect: " + mStackRect);
Log.d(TAG, "\tmCurrentStackRect: " + mCurrentStackRect);
Log.d(TAG, "\tmTaskRect: " + mTaskRect);
Log.d(TAG, "\tmSystemInsets: " + mSystemInsets);
}
@@ -375,7 +376,7 @@ public class TaskStackLayoutAlgorithm {
float normX = mUnfocusedCurveInterpolator.getX(bottomOffsetPct);
mMinScrollP = 0;
mMaxScrollP = Math.max(mMinScrollP,
(mNumStackTasks - 1) - mUnfocusedRange.getAbsoluteX(normX));
(mNumStackTasks - 1) - Math.max(0, mUnfocusedRange.getAbsoluteX(normX)));
}
}
@@ -570,7 +571,7 @@ public class TaskStackLayoutAlgorithm {
p = (mMinScrollP - stackScroll) / mNumStackTasks;
int centerYOffset = (mCurrentStackRect.top - mTaskRect.top) +
(mCurrentStackRect.height() - mTaskRect.height()) / 2;
y = (int) (centerYOffset + (p * mCurrentStackRect.height()));
y = centerYOffset + getYForDeltaP(p, 0);
z = mMaxTranslationZ;
relP = p;