commit | 90ec8bf0ed5e56c198e1eae62d308f825e385aa2 | [log] [tgz] |
---|---|---|
author | Gabriel Peal <gabriel@tonal.com> | Sat Jan 15 21:41:05 2022 -0800 |
committer | Gabriel Peal <gabriel@tonal.com> | Sat Jan 15 21:41:05 2022 -0800 |
tree | eb9b02d2209221cb69b017e8fb31f3ce8ccf06e6 | |
parent | 700aace914a3e8d37e6c43c9f4c3d16cee147e65 [diff] |
Notify AnimationListener onEnd when animations are cancelled
diff --git a/issue-repro/src/main/res/layout/issue_repro_activity.xml b/issue-repro/src/main/res/layout/issue_repro_activity.xml index df05e85..dc479bb 100755 --- a/issue-repro/src/main/res/layout/issue_repro_activity.xml +++ b/issue-repro/src/main/res/layout/issue_repro_activity.xml
@@ -9,6 +9,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" + app:lottie_rawRes="@raw/heart" app:lottie_autoPlay="true" app:lottie_loop="true" /> </FrameLayout> \ No newline at end of file
diff --git a/lottie/src/main/java/com/airbnb/lottie/utils/LottieValueAnimator.java b/lottie/src/main/java/com/airbnb/lottie/utils/LottieValueAnimator.java index 2a69b45..6451c1a 100644 --- a/lottie/src/main/java/com/airbnb/lottie/utils/LottieValueAnimator.java +++ b/lottie/src/main/java/com/airbnb/lottie/utils/LottieValueAnimator.java
@@ -262,6 +262,11 @@ return maxFrame == Integer.MAX_VALUE ? composition.getEndFrame() : maxFrame; } + @Override void notifyCancel() { + super.notifyCancel(); + notifyEnd(isReversed()); + } + protected void postFrameCallback() { if (isRunning()) { removeFrameCallback(false);