Merge "Fix the logic of canceling previous scheduled fade in animation." into qt-dev

am: 289583ec1a

Change-Id: Id0886d75e65fed676d828d7d0f1e6783c6a1d837
This commit is contained in:
Tracy Zhou
2019-06-04 18:21:31 -07:00
committed by android-build-merger

View File

@@ -410,7 +410,7 @@ public class BoundsAnimationController {
@VisibleForTesting @VisibleForTesting
boolean animatingToLargerSize() { boolean animatingToLargerSize() {
// TODO: Fix this check for aspect ratio changes // TODO: Fix this check for aspect ratio changes
return (mFrom.width() * mFrom.height() <= mTo.width() * mTo.height()); return (mFrom.width() * mFrom.height() < mTo.width() * mTo.height());
} }
@Override @Override
@@ -453,16 +453,10 @@ public class BoundsAnimationController {
boolean moveFromFullscreen, boolean moveToFullscreen, boolean moveFromFullscreen, boolean moveToFullscreen,
@AnimationType int animationType) { @AnimationType int animationType) {
final BoundsAnimator existing = mRunningAnimations.get(target); final BoundsAnimator existing = mRunningAnimations.get(target);
// animateBoundsImpl gets called twice for each animation. The second time we get the final
// to rect that respects the shelf, which is when we want to resize. Our signal for fade in if (isRunningFadeInAnimation(target) && from.width() == to.width()
// comes in from how to enter into pip, but we also need to use the to and from rect to && from.height() == to.height()) {
// decide which animation we want to run finally. animationType = FADE_IN;
boolean shouldResize = false;
if (isRunningFadeInAnimation(target)) {
shouldResize = true;
if (from.contains(to)) {
animationType = FADE_IN;
}
} }
final boolean replacing = existing != null; final boolean replacing = existing != null;
@SchedulePipModeChangedState int prevSchedulePipModeChangedState = @SchedulePipModeChangedState int prevSchedulePipModeChangedState =
@@ -523,9 +517,10 @@ public class BoundsAnimationController {
// Since we are replacing, we skip both animation start and end callbacks // Since we are replacing, we skip both animation start and end callbacks
existing.cancel(); existing.cancel();
} }
if (shouldResize) { if (animationType == FADE_IN) {
target.setPinnedStackSize(to, null); target.setPinnedStackSize(to, null);
} }
final BoundsAnimator animator = new BoundsAnimator(target, animationType, from, to, final BoundsAnimator animator = new BoundsAnimator(target, animationType, from, to,
schedulePipModeChangedState, prevSchedulePipModeChangedState, schedulePipModeChangedState, prevSchedulePipModeChangedState,
moveFromFullscreen, moveToFullscreen, frozenTask); moveFromFullscreen, moveToFullscreen, frozenTask);