Commit 930d5e7d authored by dfalcantara's avatar dfalcantara Committed by Commit bot

Prevent a negative duration animation

Haven't been able to repro this locally, but it's apparently possible for a
calculation to return a negative value for an animation duration, resulting in
a crash.

BUG=481031

Review URL: https://codereview.chromium.org/1108653002

Cr-Commit-Position: refs/heads/master@{#326871}
parent ddb02ac6
......@@ -653,7 +653,7 @@ public abstract class SwipableOverlayView extends ScrollView {
PropertyValuesHolder.ofFloat("translationY", getTranslationY(), y));
mCurrentAnimation = new AnimatorSet();
mCurrentAnimation.setDuration(duration);
mCurrentAnimation.setDuration(Math.max(duration, 0));
mCurrentAnimation.playTogether(alphaAnimator, translationXAnimator, translationYAnimator);
mCurrentAnimation.addListener(mAnimatorListenerAdapter);
mCurrentAnimation.setInterpolator(mInterpolator);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment