Merge "Prevent setting negative alpha for dim animations."

This commit is contained in:
Chavi Weingarten
2018-02-12 18:01:21 +00:00
committed by Android (Google) Code Review

View File

@@ -169,7 +169,12 @@ class SurfaceAnimationRunner {
anim.addUpdateListener(animation -> {
synchronized (mCancelLock) {
if (!a.mCancelled) {
applyTransformation(a, mFrameTransaction, anim.getCurrentPlayTime());
final long duration = anim.getDuration();
long currentPlayTime = anim.getCurrentPlayTime();
if (currentPlayTime > duration) {
currentPlayTime = duration;
}
applyTransformation(a, mFrameTransaction, currentPlayTime);
}
}