diff options
author | ztenghui <ztenghui@google.com> | 2014-06-26 12:22:58 -0700 |
---|---|---|
committer | ztenghui <ztenghui@google.com> | 2014-06-27 09:05:40 -0700 |
commit | 1c1cda0c31c4a581da7649d0df2e70f2ca77f49f (patch) | |
tree | 9b0780e8f08b4dcf26d5f4c4bd213f75c456b98f /tests/VectorDrawableTest/src/com/android/test/dynamic | |
parent | 8885ac9518b8821b90b8c1947469b6b9a37f0b7c (diff) | |
download | frameworks_base-1c1cda0c31c4a581da7649d0df2e70f2ca77f49f.zip frameworks_base-1c1cda0c31c4a581da7649d0df2e70f2ca77f49f.tar.gz frameworks_base-1c1cda0c31c4a581da7649d0df2e70f2ca77f49f.tar.bz2 |
Update the tests to show more animations from UX team
Change-Id: I16d2ed29f40c85ec48c87b5a0355e2a262ed3af7
Diffstat (limited to 'tests/VectorDrawableTest/src/com/android/test/dynamic')
-rw-r--r-- | tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedVectorDrawableTest.java | 45 |
1 files changed, 32 insertions, 13 deletions
diff --git a/tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedVectorDrawableTest.java b/tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedVectorDrawableTest.java index 6e864fa..b1ba0dd 100644 --- a/tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedVectorDrawableTest.java +++ b/tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedVectorDrawableTest.java @@ -19,24 +19,43 @@ import android.graphics.drawable.AnimatedVectorDrawable; import android.os.Bundle; import android.view.View; import android.widget.Button; +import android.widget.GridLayout; +import android.widget.ScrollView; -public class AnimatedVectorDrawableTest extends Activity { - private static final String LOGCAT = "VectorDrawableAnimationTest"; +public class AnimatedVectorDrawableTest extends Activity implements View.OnClickListener{ + private static final String LOGCAT = "AnimatedVectorDrawableTest"; + + protected int[] icon = { + R.drawable.animation_vector_drawable_grouping_1, + R.drawable.animation_vector_progress_bar, + R.drawable.animation_vector_drawable_favorite, + R.drawable.animation_vector_drawable01, + }; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - Button button = new Button(this); - button.setBackgroundResource(R.drawable.animation_vector_drawable01); - button.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - AnimatedVectorDrawable frameAnimation = (AnimatedVectorDrawable) v.getBackground(); - frameAnimation.start(); - } - }); - - setContentView(button); + ScrollView scrollView = new ScrollView(this); + GridLayout container = new GridLayout(this); + scrollView.addView(container); + container.setColumnCount(1); + + for (int i = 0; i < icon.length; i++) { + Button button = new Button(this); + button.setWidth(400); + button.setHeight(400); + button.setBackgroundResource(icon[i]); + container.addView(button); + button.setOnClickListener(this); + } + + setContentView(scrollView); + } + + @Override + public void onClick(View v) { + AnimatedVectorDrawable d = (AnimatedVectorDrawable) v.getBackground(); + d.start(); } } |