From 5b84eace6cb79c42fe43480f08c68b7dea4e074a Mon Sep 17 00:00:00 2001 From: ztenghui Date: Wed, 19 Nov 2014 10:38:18 -0800 Subject: ASLD: ASLD's XML reversible flag can turn off the reverse behavior now. Previously, the android:reversible flag behaves like a suggestion. Now it is used to enforce no reverse when set to false. In this way, user can safely setup one direction animation only. When set to true, but AVD can't reverse , then it will show a warning. At the same time, update the tests to show different cases, including AnimationDrawable. b/18413484 Change-Id: I5552c49dcbd76b0724b4d5593bce8388b27bd905 --- .../res/anim/animation_grouping_1_01.xml | 14 +++---- .../res/drawable/state_animation_drawable04.xml | 26 ++++++++++++ .../drawable/state_animation_drawable04_false.xml | 26 ++++++++++++ .../drawable/state_animation_vector_drawable01.xml | 2 +- .../state_animation_vector_drawable01_false.xml | 47 ++++++++++++++++++++++ .../state_animation_vector_drawable02_false.xml | 26 ++++++++++++ .../drawable/state_animation_vector_drawable03.xml | 2 +- .../state_animation_vector_drawable03_false.xml | 26 ++++++++++++ .../dynamic/AnimatedStateVectorDrawableTest.java | 9 ++++- 9 files changed, 166 insertions(+), 12 deletions(-) create mode 100644 tests/VectorDrawableTest/res/drawable/state_animation_drawable04.xml create mode 100644 tests/VectorDrawableTest/res/drawable/state_animation_drawable04_false.xml create mode 100644 tests/VectorDrawableTest/res/drawable/state_animation_vector_drawable01_false.xml create mode 100644 tests/VectorDrawableTest/res/drawable/state_animation_vector_drawable02_false.xml create mode 100644 tests/VectorDrawableTest/res/drawable/state_animation_vector_drawable03_false.xml (limited to 'tests/VectorDrawableTest') diff --git a/tests/VectorDrawableTest/res/anim/animation_grouping_1_01.xml b/tests/VectorDrawableTest/res/anim/animation_grouping_1_01.xml index 8d82d05c27f7..8ab79a5c6256 100644 --- a/tests/VectorDrawableTest/res/anim/animation_grouping_1_01.xml +++ b/tests/VectorDrawableTest/res/anim/animation_grouping_1_01.xml @@ -15,12 +15,8 @@ limitations under the License. --> - - - - \ No newline at end of file + diff --git a/tests/VectorDrawableTest/res/drawable/state_animation_drawable04.xml b/tests/VectorDrawableTest/res/drawable/state_animation_drawable04.xml new file mode 100644 index 000000000000..a0a801ca45d5 --- /dev/null +++ b/tests/VectorDrawableTest/res/drawable/state_animation_drawable04.xml @@ -0,0 +1,26 @@ + + + + + + + + diff --git a/tests/VectorDrawableTest/res/drawable/state_animation_drawable04_false.xml b/tests/VectorDrawableTest/res/drawable/state_animation_drawable04_false.xml new file mode 100644 index 000000000000..3cf8e483eb51 --- /dev/null +++ b/tests/VectorDrawableTest/res/drawable/state_animation_drawable04_false.xml @@ -0,0 +1,26 @@ + + + + + + + + diff --git a/tests/VectorDrawableTest/res/drawable/state_animation_vector_drawable01.xml b/tests/VectorDrawableTest/res/drawable/state_animation_vector_drawable01.xml index 18d7755471e0..768fe39f26af 100644 --- a/tests/VectorDrawableTest/res/drawable/state_animation_vector_drawable01.xml +++ b/tests/VectorDrawableTest/res/drawable/state_animation_vector_drawable01.xml @@ -17,7 +17,7 @@ - diff --git a/tests/VectorDrawableTest/res/drawable/state_animation_vector_drawable01_false.xml b/tests/VectorDrawableTest/res/drawable/state_animation_vector_drawable01_false.xml new file mode 100644 index 000000000000..96d378c26b47 --- /dev/null +++ b/tests/VectorDrawableTest/res/drawable/state_animation_vector_drawable01_false.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + diff --git a/tests/VectorDrawableTest/res/drawable/state_animation_vector_drawable02_false.xml b/tests/VectorDrawableTest/res/drawable/state_animation_vector_drawable02_false.xml new file mode 100644 index 000000000000..b722da15d9d1 --- /dev/null +++ b/tests/VectorDrawableTest/res/drawable/state_animation_vector_drawable02_false.xml @@ -0,0 +1,26 @@ + + + + + + + + diff --git a/tests/VectorDrawableTest/res/drawable/state_animation_vector_drawable03.xml b/tests/VectorDrawableTest/res/drawable/state_animation_vector_drawable03.xml index 65cf25be4cc7..e24dd1fc5b49 100644 --- a/tests/VectorDrawableTest/res/drawable/state_animation_vector_drawable03.xml +++ b/tests/VectorDrawableTest/res/drawable/state_animation_vector_drawable03.xml @@ -17,7 +17,7 @@ - + + + + + + + diff --git a/tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedStateVectorDrawableTest.java b/tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedStateVectorDrawableTest.java index 566cc4b5de4e..538655552d28 100644 --- a/tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedStateVectorDrawableTest.java +++ b/tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedStateVectorDrawableTest.java @@ -27,9 +27,16 @@ public class AnimatedStateVectorDrawableTest extends Activity { private static final String LOGCAT = "AnimatedStateVectorDrawableTest"; protected int[] icon = { + // These shows pairs of ASLD , the left side set the reversible to true. + // the right side set to false. R.drawable.state_animation_vector_drawable01, + R.drawable.state_animation_vector_drawable01_false, R.drawable.state_animation_vector_drawable02, + R.drawable.state_animation_vector_drawable02_false, R.drawable.state_animation_vector_drawable03, + R.drawable.state_animation_vector_drawable03_false, + R.drawable.state_animation_drawable04, + R.drawable.state_animation_drawable04_false, }; @Override @@ -39,7 +46,7 @@ public class AnimatedStateVectorDrawableTest extends Activity { ScrollView scrollView = new ScrollView(this); GridLayout container = new GridLayout(this); scrollView.addView(container); - container.setColumnCount(5); + container.setColumnCount(2); for (int i = 0; i < icon.length; i++) { CheckBox button = new CheckBox(this); -- cgit v1.2.3-59-g8ed1b