summaryrefslogtreecommitdiffstats
path: root/tests/VectorDrawableTest
diff options
context:
space:
mode:
authorztenghui <ztenghui@google.com>2015-03-24 14:11:37 -0700
committerztenghui <ztenghui@google.com>2015-03-24 15:49:13 -0700
commit1588f0ff54b88240b55eeaba97e67f0f1dee5f92 (patch)
tree2f9ab06c201b4d4717ab46111f3efa2e69451da3 /tests/VectorDrawableTest
parent111928fa324db73f94389bdfab4b108cbd30d8f4 (diff)
downloadframeworks_base-1588f0ff54b88240b55eeaba97e67f0f1dee5f92.zip
frameworks_base-1588f0ff54b88240b55eeaba97e67f0f1dee5f92.tar.gz
frameworks_base-1588f0ff54b88240b55eeaba97e67f0f1dee5f92.tar.bz2
Add listener support in AVD
Internally, switch to use AnimatorSet instead of an array of Animators b/19825918 Change-Id: Ia67d2cc7dd89362e6b0019c916d3f2a0d0f3e39e
Diffstat (limited to 'tests/VectorDrawableTest')
-rw-r--r--tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedVectorDrawableTest.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedVectorDrawableTest.java b/tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedVectorDrawableTest.java
index ecc7782..56c8119 100644
--- a/tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedVectorDrawableTest.java
+++ b/tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedVectorDrawableTest.java
@@ -14,9 +14,12 @@
package com.android.test.dynamic;
+import android.animation.Animator;
+import android.animation.Animator.AnimatorListener;
import android.app.Activity;
import android.graphics.drawable.AnimatedVectorDrawable;
import android.os.Bundle;
+import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.GridLayout;
@@ -52,6 +55,26 @@ public class AnimatedVectorDrawableTest extends Activity implements View.OnClick
button.setWidth(400);
button.setHeight(400);
button.setBackgroundResource(icon[i]);
+ AnimatedVectorDrawable d = (AnimatedVectorDrawable) button.getBackground();
+ d.addListener(new AnimatorListener() {
+ @Override
+ public void onAnimationStart(Animator animation) {
+ 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");
+ }
+ });
+
container.addView(button);
button.setOnClickListener(this);
}