diff options
author | ztenghui <ztenghui@google.com> | 2014-07-15 15:12:12 -0700 |
---|---|---|
committer | Tenghui Zhu <ztenghui@google.com> | 2014-07-16 19:26:26 +0000 |
commit | 7bc6a3f023ca3e1dde91fc97b6036dee3ba538a2 (patch) | |
tree | 542fd3fbf1f158bf609bf615d6dcf83a5331f5b4 /tests | |
parent | ce83a28c244b69e9602af84d120494d302decbeb (diff) | |
download | frameworks_base-7bc6a3f023ca3e1dde91fc97b6036dee3ba538a2.zip frameworks_base-7bc6a3f023ca3e1dde91fc97b6036dee3ba538a2.tar.gz frameworks_base-7bc6a3f023ca3e1dde91fc97b6036dee3ba538a2.tar.bz2 |
Add more reverse support to AnimatedVD
bug:16162242
Change-Id: Ie0b7618beeb65ebeb65db41600165837524bcee4
Diffstat (limited to 'tests')
-rw-r--r-- | tests/VectorDrawableTest/res/drawable/state_animation_vector_drawable01.xml (renamed from tests/VectorDrawableTest/res/drawable/state_animation_vector_drawable.xml) | 2 | ||||
-rw-r--r-- | tests/VectorDrawableTest/res/drawable/state_animation_vector_drawable02.xml | 26 | ||||
-rw-r--r-- | tests/VectorDrawableTest/res/drawable/state_animation_vector_drawable03.xml | 26 | ||||
-rw-r--r-- | tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedStateVectorDrawableTest.java | 6 |
4 files changed, 57 insertions, 3 deletions
diff --git a/tests/VectorDrawableTest/res/drawable/state_animation_vector_drawable.xml b/tests/VectorDrawableTest/res/drawable/state_animation_vector_drawable01.xml index 30fb1b8..18d7755 100644 --- a/tests/VectorDrawableTest/res/drawable/state_animation_vector_drawable.xml +++ b/tests/VectorDrawableTest/res/drawable/state_animation_vector_drawable01.xml @@ -19,7 +19,7 @@ android:drawable="@drawable/vector_drawable12" /> <item android:id="@+id/off" android:drawable="@drawable/vector_drawable12" /> - <transition android:fromId="@+id/off" android:toId="@+id/on"> + <transition android:fromId="@+id/off" android:toId="@+id/on" android:reversible="true"> <animated-vector android:drawable="@drawable/vector_drawable12"> <target android:name="pie1" diff --git a/tests/VectorDrawableTest/res/drawable/state_animation_vector_drawable02.xml b/tests/VectorDrawableTest/res/drawable/state_animation_vector_drawable02.xml new file mode 100644 index 0000000..6a67b02 --- /dev/null +++ b/tests/VectorDrawableTest/res/drawable/state_animation_vector_drawable02.xml @@ -0,0 +1,26 @@ +<!-- + Copyright (C) 2014 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<animated-selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:id="@+id/on" android:state_checked="true" + android:drawable="@drawable/vector_drawable_grouping_1" /> + <item android:id="@+id/off" + android:drawable="@drawable/vector_drawable_grouping_1" /> + <transition android:fromId="@+id/off" android:toId="@+id/on" + android:drawable="@drawable/animation_vector_drawable_grouping_1" + android:reversible="true"> + </transition> +</animated-selector> diff --git a/tests/VectorDrawableTest/res/drawable/state_animation_vector_drawable03.xml b/tests/VectorDrawableTest/res/drawable/state_animation_vector_drawable03.xml new file mode 100644 index 0000000..65cf25b --- /dev/null +++ b/tests/VectorDrawableTest/res/drawable/state_animation_vector_drawable03.xml @@ -0,0 +1,26 @@ +<!-- + Copyright (C) 2014 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<animated-selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:id="@+id/on" android:state_checked="true" + android:drawable="@drawable/vector_drawable_favorite" /> + <item android:id="@+id/off" + android:drawable="@drawable/vector_drawable_favorite" /> + <transition android:fromId="@+id/off" android:toId="@+id/on" + android:drawable="@drawable/animation_vector_drawable_favorite" + android:reversible="true"> + </transition> +</animated-selector> diff --git a/tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedStateVectorDrawableTest.java b/tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedStateVectorDrawableTest.java index 0ae0136..566cc4b 100644 --- a/tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedStateVectorDrawableTest.java +++ b/tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedStateVectorDrawableTest.java @@ -27,7 +27,9 @@ public class AnimatedStateVectorDrawableTest extends Activity { private static final String LOGCAT = "AnimatedStateVectorDrawableTest"; protected int[] icon = { - R.drawable.state_animation_vector_drawable + R.drawable.state_animation_vector_drawable01, + R.drawable.state_animation_vector_drawable02, + R.drawable.state_animation_vector_drawable03, }; @Override @@ -37,7 +39,7 @@ public class AnimatedStateVectorDrawableTest extends Activity { ScrollView scrollView = new ScrollView(this); GridLayout container = new GridLayout(this); scrollView.addView(container); - container.setColumnCount(1); + container.setColumnCount(5); for (int i = 0; i < icon.length; i++) { CheckBox button = new CheckBox(this); |