diff --git a/api/current.txt b/api/current.txt index 2bedcbb08c410..3b4796dd2de96 100644 --- a/api/current.txt +++ b/api/current.txt @@ -12191,6 +12191,7 @@ package android.graphics.drawable { method public int getOpacity(); method public boolean isRunning(); method public void registerAnimationCallback(android.graphics.drawable.Animatable2.AnimationCallback); + method public void reset(); method public void setAlpha(int); method public void setColorFilter(android.graphics.ColorFilter); method public void start(); diff --git a/api/system-current.txt b/api/system-current.txt index 3afe075de535b..3fb0920f9b7fd 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -12504,6 +12504,7 @@ package android.graphics.drawable { method public int getOpacity(); method public boolean isRunning(); method public void registerAnimationCallback(android.graphics.drawable.Animatable2.AnimationCallback); + method public void reset(); method public void setAlpha(int); method public void setColorFilter(android.graphics.ColorFilter); method public void start(); diff --git a/graphics/java/android/graphics/drawable/AnimatedVectorDrawable.java b/graphics/java/android/graphics/drawable/AnimatedVectorDrawable.java index 96f86b4d7ae7f..1ae10d31ad458 100644 --- a/graphics/java/android/graphics/drawable/AnimatedVectorDrawable.java +++ b/graphics/java/android/graphics/drawable/AnimatedVectorDrawable.java @@ -578,6 +578,15 @@ public class AnimatedVectorDrawable extends Drawable implements Animatable2 { return mAnimatorSet.isStarted(); } + /** + * Resets the AnimatedVectorDrawable to the start state as specified in the animators. + */ + public void reset() { + // TODO: Use reverse or seek to implement reset, when AnimatorSet supports them. + start(); + mAnimatorSet.cancel(); + } + @Override public void start() { ensureAnimatorSet();