commit | f1107f7891c503c5eb6b1166997cfa38ce1cbf58 | [log] [tgz] |
---|---|---|
author | Jorge Betancourt <jmbetancourt@google.com> | Wed Feb 24 13:49:55 2021 -0500 |
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | Thu Feb 25 21:21:02 2021 +0000 |
tree | e1e3add2e0d7992081baf848e0fc34611a375f00 | |
parent | 0b398cb2f4ad0f37d3e86565484664f8c5570d50 [diff] |
[SkottieView] surface methods for adding and removing listeners in SkottieView Change-Id: Iaa97a5661269c9f725cf44f977fed12c3c994b31 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/375070 Reviewed-by: Stan Iliev <stani@google.com> Commit-Queue: Stan Iliev <stani@google.com>
diff --git a/platform_tools/android/apps/skottie/skottielib/src/main/java/org/skia/skottie/SkottieView.java b/platform_tools/android/apps/skottie/skottielib/src/main/java/org/skia/skottie/SkottieView.java index d19ee6a..7210436 100644 --- a/platform_tools/android/apps/skottie/skottielib/src/main/java/org/skia/skottie/SkottieView.java +++ b/platform_tools/android/apps/skottie/skottielib/src/main/java/org/skia/skottie/SkottieView.java
@@ -7,6 +7,7 @@ package org.skia.skottie; +import android.animation.Animator; import android.content.Context; import android.content.res.TypedArray; import android.graphics.Color; @@ -163,6 +164,14 @@ return mAnimation; } + public void removeListener(Animator.AnimatorListener listener) { + mAnimation.removeListener(listener); + } + + public void addListener(Animator.AnimatorListener listener) { + mAnimation.addListener(listener); + } + // progress: a float from 0 to 1 representing the percent into the animation public void seek(float progress) { if(mAnimation != null) {