Make RectFSpringAnim resilient to negative height starting rect.

Test: ran tapl tests, failed before, passed after
Change-Id: I10b82dd348b5c12550e60b145c76dad542aa56e8
This commit is contained in:
Zak Cohen
2020-02-26 10:53:53 -08:00
parent d71c3b185d
commit f2a15f1be5
@@ -165,7 +165,7 @@ public class RectFSpringAnim {
mRectYAnim = new FlingSpringAnim(this, RECT_Y, startY, endY, startVelocityY,
mMinVisChange, minYValue, maxYValue, springVelocityFactor, onYEndListener);
float minVisibleChange = 1f / mStartRect.height();
float minVisibleChange = Math.abs(1f / mStartRect.height());
mRectScaleAnim = new SpringAnimation(this, RECT_SCALE_PROGRESS)
.setSpring(new SpringForce(1f)
.setDampingRatio(SpringForce.DAMPING_RATIO_LOW_BOUNCY)