Merge "Prevent conflicting animations from starting." into rvc-dev

This commit is contained in:
TreeHugger Robot
2020-05-21 02:03:23 +00:00
committed by Android (Google) Code Review
3 changed files with 10 additions and 2 deletions

View File

@@ -879,7 +879,7 @@ public class BubbleStackView extends FrameLayout
}
}
return false;
return true;
});
}

View File

@@ -767,6 +767,10 @@ public class PhysicsAnimationLayout extends FrameLayout {
int targetAnimDuration,
TimeInterpolator targetAnimInterpolator,
Runnable... pathAnimEndActions) {
if (mPathAnimator != null) {
mPathAnimator.cancel();
}
mPathAnimator = ObjectAnimator.ofFloat(
this, mCurrentPointOnPathXProperty, mCurrentPointOnPathYProperty, path);

View File

@@ -459,6 +459,10 @@ public class StackAnimationController extends
float friction,
SpringForce spring,
Float finalPosition) {
if (!isActiveController()) {
return;
}
Log.d(TAG, String.format("Flinging %s.",
PhysicsAnimationLayout.getReadablePropertyName(property)));
@@ -679,7 +683,7 @@ public class StackAnimationController extends
DynamicAnimation.ViewProperty property, SpringForce spring,
float vel, float finalPosition, @Nullable Runnable... after) {
if (mLayout.getChildCount() == 0) {
if (mLayout.getChildCount() == 0 || !isActiveController()) {
return;
}