From 1c1cda0c31c4a581da7649d0df2e70f2ca77f49f Mon Sep 17 00:00:00 2001 From: ztenghui Date: Thu, 26 Jun 2014 12:22:58 -0700 Subject: Update the tests to show more animations from UX team Change-Id: I16d2ed29f40c85ec48c87b5a0355e2a262ed3af7 --- .../res/anim/animation_favorite.xml | 29 +++++++++++ .../res/anim/animation_favorite02.xml | 35 ++++++++++++++ .../res/anim/animation_grouping_1_01.xml | 26 ++++++++++ .../res/anim/animation_grouping_1_02.xml | 35 ++++++++++++++ .../res/anim/trim_path_animation_progress_bar.xml | 45 +++++++++++++++++ .../res/drawable/animation_vector_drawable01.xml | 4 +- .../animation_vector_drawable_favorite.xml | 26 ++++++++++ .../animation_vector_drawable_grouping_1.xml | 26 ++++++++++ .../res/drawable/animation_vector_progress_bar.xml | 23 +++++++++ .../res/drawable/vector_drawable_favorite.xml | 42 ++++++++++++++++ .../res/drawable/vector_drawable_grouping_1.xml | 56 ++++++++++++++++++++++ .../res/drawable/vector_drawable_progress_bar.xml | 52 ++++++++++++++++++++ .../custom_path_interpolator_favorite.xml | 2 + .../custom_path_interpolator_grouping_1_01.xml | 2 + .../res/interpolator/trim_end_interpolator.xml | 2 + .../res/interpolator/trim_start_interpolator.xml | 2 + tests/VectorDrawableTest/res/values/strings.xml | 18 +++---- .../test/dynamic/AnimatedVectorDrawableTest.java | 45 ++++++++++++----- 18 files changed, 446 insertions(+), 24 deletions(-) create mode 100644 tests/VectorDrawableTest/res/anim/animation_favorite.xml create mode 100644 tests/VectorDrawableTest/res/anim/animation_favorite02.xml create mode 100644 tests/VectorDrawableTest/res/anim/animation_grouping_1_01.xml create mode 100644 tests/VectorDrawableTest/res/anim/animation_grouping_1_02.xml create mode 100644 tests/VectorDrawableTest/res/anim/trim_path_animation_progress_bar.xml create mode 100644 tests/VectorDrawableTest/res/drawable/animation_vector_drawable_favorite.xml create mode 100644 tests/VectorDrawableTest/res/drawable/animation_vector_drawable_grouping_1.xml create mode 100644 tests/VectorDrawableTest/res/drawable/animation_vector_progress_bar.xml create mode 100644 tests/VectorDrawableTest/res/drawable/vector_drawable_favorite.xml create mode 100644 tests/VectorDrawableTest/res/drawable/vector_drawable_grouping_1.xml create mode 100644 tests/VectorDrawableTest/res/drawable/vector_drawable_progress_bar.xml create mode 100644 tests/VectorDrawableTest/res/interpolator/custom_path_interpolator_favorite.xml create mode 100644 tests/VectorDrawableTest/res/interpolator/custom_path_interpolator_grouping_1_01.xml create mode 100644 tests/VectorDrawableTest/res/interpolator/trim_end_interpolator.xml create mode 100644 tests/VectorDrawableTest/res/interpolator/trim_start_interpolator.xml (limited to 'tests/VectorDrawableTest') diff --git a/tests/VectorDrawableTest/res/anim/animation_favorite.xml b/tests/VectorDrawableTest/res/anim/animation_favorite.xml new file mode 100644 index 0000000..c81ba40 --- /dev/null +++ b/tests/VectorDrawableTest/res/anim/animation_favorite.xml @@ -0,0 +1,29 @@ + + + + + + + + \ No newline at end of file diff --git a/tests/VectorDrawableTest/res/anim/animation_favorite02.xml b/tests/VectorDrawableTest/res/anim/animation_favorite02.xml new file mode 100644 index 0000000..15d3b8e --- /dev/null +++ b/tests/VectorDrawableTest/res/anim/animation_favorite02.xml @@ -0,0 +1,35 @@ + + + + + + + + + \ No newline at end of file diff --git a/tests/VectorDrawableTest/res/anim/animation_grouping_1_01.xml b/tests/VectorDrawableTest/res/anim/animation_grouping_1_01.xml new file mode 100644 index 0000000..8d82d05 --- /dev/null +++ b/tests/VectorDrawableTest/res/anim/animation_grouping_1_01.xml @@ -0,0 +1,26 @@ + + + + + + + \ No newline at end of file diff --git a/tests/VectorDrawableTest/res/anim/animation_grouping_1_02.xml b/tests/VectorDrawableTest/res/anim/animation_grouping_1_02.xml new file mode 100644 index 0000000..ae63203 --- /dev/null +++ b/tests/VectorDrawableTest/res/anim/animation_grouping_1_02.xml @@ -0,0 +1,35 @@ + + + + + + + + + \ No newline at end of file diff --git a/tests/VectorDrawableTest/res/anim/trim_path_animation_progress_bar.xml b/tests/VectorDrawableTest/res/anim/trim_path_animation_progress_bar.xml new file mode 100644 index 0000000..f510256 --- /dev/null +++ b/tests/VectorDrawableTest/res/anim/trim_path_animation_progress_bar.xml @@ -0,0 +1,45 @@ + + + + + + + + + + \ No newline at end of file diff --git a/tests/VectorDrawableTest/res/drawable/animation_vector_drawable01.xml b/tests/VectorDrawableTest/res/drawable/animation_vector_drawable01.xml index b37b19f..19b82ad 100644 --- a/tests/VectorDrawableTest/res/drawable/animation_vector_drawable01.xml +++ b/tests/VectorDrawableTest/res/drawable/animation_vector_drawable01.xml @@ -19,14 +19,12 @@ - - @@ -40,4 +38,4 @@ android:name="rotationGroup" android:animation="@anim/trim_path_animation04" /> - + \ No newline at end of file diff --git a/tests/VectorDrawableTest/res/drawable/animation_vector_drawable_favorite.xml b/tests/VectorDrawableTest/res/drawable/animation_vector_drawable_favorite.xml new file mode 100644 index 0000000..9d8381f --- /dev/null +++ b/tests/VectorDrawableTest/res/drawable/animation_vector_drawable_favorite.xml @@ -0,0 +1,26 @@ + + + + + + + \ No newline at end of file diff --git a/tests/VectorDrawableTest/res/drawable/animation_vector_drawable_grouping_1.xml b/tests/VectorDrawableTest/res/drawable/animation_vector_drawable_grouping_1.xml new file mode 100644 index 0000000..4a7e4f6 --- /dev/null +++ b/tests/VectorDrawableTest/res/drawable/animation_vector_drawable_grouping_1.xml @@ -0,0 +1,26 @@ + + + + + + + \ No newline at end of file diff --git a/tests/VectorDrawableTest/res/drawable/animation_vector_progress_bar.xml b/tests/VectorDrawableTest/res/drawable/animation_vector_progress_bar.xml new file mode 100644 index 0000000..6621e41 --- /dev/null +++ b/tests/VectorDrawableTest/res/drawable/animation_vector_progress_bar.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable_favorite.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable_favorite.xml new file mode 100644 index 0000000..c8840f5 --- /dev/null +++ b/tests/VectorDrawableTest/res/drawable/vector_drawable_favorite.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable_grouping_1.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable_grouping_1.xml new file mode 100644 index 0000000..558de94 --- /dev/null +++ b/tests/VectorDrawableTest/res/drawable/vector_drawable_grouping_1.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable_progress_bar.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable_progress_bar.xml new file mode 100644 index 0000000..956c600 --- /dev/null +++ b/tests/VectorDrawableTest/res/drawable/vector_drawable_progress_bar.xml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/VectorDrawableTest/res/interpolator/custom_path_interpolator_favorite.xml b/tests/VectorDrawableTest/res/interpolator/custom_path_interpolator_favorite.xml new file mode 100644 index 0000000..935d5b5 --- /dev/null +++ b/tests/VectorDrawableTest/res/interpolator/custom_path_interpolator_favorite.xml @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/tests/VectorDrawableTest/res/interpolator/custom_path_interpolator_grouping_1_01.xml b/tests/VectorDrawableTest/res/interpolator/custom_path_interpolator_grouping_1_01.xml new file mode 100644 index 0000000..8c57395 --- /dev/null +++ b/tests/VectorDrawableTest/res/interpolator/custom_path_interpolator_grouping_1_01.xml @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/tests/VectorDrawableTest/res/interpolator/trim_end_interpolator.xml b/tests/VectorDrawableTest/res/interpolator/trim_end_interpolator.xml new file mode 100644 index 0000000..b2770cd --- /dev/null +++ b/tests/VectorDrawableTest/res/interpolator/trim_end_interpolator.xml @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/tests/VectorDrawableTest/res/interpolator/trim_start_interpolator.xml b/tests/VectorDrawableTest/res/interpolator/trim_start_interpolator.xml new file mode 100644 index 0000000..798f7e6 --- /dev/null +++ b/tests/VectorDrawableTest/res/interpolator/trim_start_interpolator.xml @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/tests/VectorDrawableTest/res/values/strings.xml b/tests/VectorDrawableTest/res/values/strings.xml index 6ae3d7f..54cffa8 100644 --- a/tests/VectorDrawableTest/res/values/strings.xml +++ b/tests/VectorDrawableTest/res/values/strings.xml @@ -1,5 +1,6 @@ - - "M 0,0 v 100 M 0,0 h 100" - "M300,70 l 0,-70 70,70 0,0 -70,70z" - "M300,70 l 0,-70 70,0 0,140 -70,0 z" + "M 0,0 v 100 M 0,0 h 100" + "M300,70 l 0,-70 70,70 0,0 -70,70z" + "M300,70 l 0,-70 70,0 0,140 -70,0 z" + "M300,70 l 0,-70 70,0 0,70z M300,70 l 70,0 0,70 -70,0z" + "M300,35 l 0,-35 70,0 0,35z M300,105 l 70,0 0,35 -70,0z" + "m2.10001,-6c-1.9551,0 -0.5,0.02499 -2.10001,0.02499c-1.575,0 0.0031,-0.02499 -1.95,-0.02499c-2.543,0 -4,2.2816 -4,4.85001c0,3.52929 0.25,6.25 5.95,6.25c5.7,0 6,-2.72071 6,-6.25c0,-2.56841 -1.35699,-4.85001 -3.89999,-4.85001" + "m4.5,-7c-1.95509,0 -3.83009,1.26759 -4.5,3c-0.66991,-1.73241 -2.54691,-3 -4.5,-3c-2.543,0 -4.5,1.93159 -4.5,4.5c0,3.5293 3.793,6.2578 9,11.5c5.207,-5.2422 9,-7.9707 9,-11.5c0,-2.56841 -1.957,-4.5 -4.5,-4.5" - "M300,70 l 0,-70 70,0 0,70z M300,70 l 70,0 0,70 -70,0z" - "M300,35 l 0,-35 70,0 0,35z M300,105 l 70,0 0,35 -70,0z" - - + \ No newline at end of file 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(); } } -- cgit v1.1