diff options
author | ztenghui <ztenghui@google.com> | 2014-07-16 19:27:09 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-07-16 00:46:50 +0000 |
commit | 0d12785dfbbed04c2f1bc000d7f0722d22d75f4a (patch) | |
tree | 75c3bb3df5ad3c6b2b881613fd4e2a375743df46 /tests | |
parent | 71940885f2748046dd744b039f9e18adef54673b (diff) | |
parent | 7bc6a3f023ca3e1dde91fc97b6036dee3ba538a2 (diff) | |
download | frameworks_base-0d12785dfbbed04c2f1bc000d7f0722d22d75f4a.zip frameworks_base-0d12785dfbbed04c2f1bc000d7f0722d22d75f4a.tar.gz frameworks_base-0d12785dfbbed04c2f1bc000d7f0722d22d75f4a.tar.bz2 |
Merge "Add more reverse support to AnimatedVD" into lmp-dev
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); |