summaryrefslogtreecommitdiffstats
path: root/tests/VectorDrawableTest
diff options
context:
space:
mode:
authorztenghui <ztenghui@google.com>2015-05-29 17:19:41 -0700
committerztenghui <ztenghui@google.com>2015-06-04 12:55:21 -0700
commit83a52031fd5c277d0c6e75da50bf8013e8a70399 (patch)
tree7d1cf90ee2ccead94abe77cee440fc64a7d7b88f /tests/VectorDrawableTest
parent1da56b51d59aa4c587dcdb5bf4c1719961be0ae7 (diff)
downloadframeworks_base-83a52031fd5c277d0c6e75da50bf8013e8a70399.zip
frameworks_base-83a52031fd5c277d0c6e75da50bf8013e8a70399.tar.gz
frameworks_base-83a52031fd5c277d0c6e75da50bf8013e8a70399.tar.bz2
Setup the animation callback for AnimatedVectorDrawable
b/21341096 Change-Id: I84e20366db21ceaa4f044be3e322f9215bb06ad2
Diffstat (limited to 'tests/VectorDrawableTest')
-rw-r--r--tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedVectorDrawableTest.java25
1 files changed, 9 insertions, 16 deletions
diff --git a/tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedVectorDrawableTest.java b/tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedVectorDrawableTest.java
index 56c8119..087e68a 100644
--- a/tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedVectorDrawableTest.java
+++ b/tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedVectorDrawableTest.java
@@ -14,10 +14,10 @@
package com.android.test.dynamic;
-import android.animation.Animator;
-import android.animation.Animator.AnimatorListener;
import android.app.Activity;
+import android.graphics.drawable.Animatable2;
import android.graphics.drawable.AnimatedVectorDrawable;
+import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
@@ -56,22 +56,15 @@ public class AnimatedVectorDrawableTest extends Activity implements View.OnClick
button.setHeight(400);
button.setBackgroundResource(icon[i]);
AnimatedVectorDrawable d = (AnimatedVectorDrawable) button.getBackground();
- d.addListener(new AnimatorListener() {
- @Override
- public void onAnimationStart(Animator animation) {
+ d.registerAnimationCallback(new Animatable2.AnimationCallback() {
+ @Override
+ public void onAnimationStart(Drawable drawable) {
Log.v(LOGCAT, "Animator start");
}
- @Override
- public void onAnimationRepeat(Animator animation) {
- Log.v(LOGCAT, "Animator repeat");
- }
- @Override
- public void onAnimationEnd(Animator animation) {
- Log.v(LOGCAT, "Animator end");
- }
- @Override
- public void onAnimationCancel(Animator animation) {
- Log.v(LOGCAT, "Animator cancel");
+
+ @Override
+ public void onAnimationEnd(Drawable drawable) {
+ Log.v(LOGCAT, "Animator end");
}
});