summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorztenghui <ztenghui@google.com>2014-06-26 12:22:58 -0700
committerztenghui <ztenghui@google.com>2014-06-27 09:05:40 -0700
commit1c1cda0c31c4a581da7649d0df2e70f2ca77f49f (patch)
tree9b0780e8f08b4dcf26d5f4c4bd213f75c456b98f /tests
parent8885ac9518b8821b90b8c1947469b6b9a37f0b7c (diff)
downloadframeworks_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')
-rw-r--r--tests/VectorDrawableTest/res/anim/animation_favorite.xml29
-rw-r--r--tests/VectorDrawableTest/res/anim/animation_favorite02.xml35
-rw-r--r--tests/VectorDrawableTest/res/anim/animation_grouping_1_01.xml26
-rw-r--r--tests/VectorDrawableTest/res/anim/animation_grouping_1_02.xml35
-rw-r--r--tests/VectorDrawableTest/res/anim/trim_path_animation_progress_bar.xml45
-rw-r--r--tests/VectorDrawableTest/res/drawable/animation_vector_drawable01.xml4
-rw-r--r--tests/VectorDrawableTest/res/drawable/animation_vector_drawable_favorite.xml26
-rw-r--r--tests/VectorDrawableTest/res/drawable/animation_vector_drawable_grouping_1.xml26
-rw-r--r--tests/VectorDrawableTest/res/drawable/animation_vector_progress_bar.xml23
-rw-r--r--tests/VectorDrawableTest/res/drawable/vector_drawable_favorite.xml42
-rw-r--r--tests/VectorDrawableTest/res/drawable/vector_drawable_grouping_1.xml56
-rw-r--r--tests/VectorDrawableTest/res/drawable/vector_drawable_progress_bar.xml52
-rw-r--r--tests/VectorDrawableTest/res/interpolator/custom_path_interpolator_favorite.xml2
-rw-r--r--tests/VectorDrawableTest/res/interpolator/custom_path_interpolator_grouping_1_01.xml2
-rw-r--r--tests/VectorDrawableTest/res/interpolator/trim_end_interpolator.xml2
-rw-r--r--tests/VectorDrawableTest/res/interpolator/trim_start_interpolator.xml2
-rw-r--r--tests/VectorDrawableTest/res/values/strings.xml18
-rw-r--r--tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedVectorDrawableTest.java45
18 files changed, 446 insertions, 24 deletions
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 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ 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.
+-->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android" >
+
+ <objectAnimator
+ android:duration="8000"
+ android:interpolator="@interpolator/custom_path_interpolator_favorite"
+ android:propertyName="pathData"
+ android:repeatCount="-1"
+ android:valueFrom="@string/round_box"
+ android:valueTo="@string/heart"
+ android:valueType="pathType" />
+
+</set> \ 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 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ 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.
+-->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android" >
+
+ <objectAnimator
+ android:duration="8000"
+ android:interpolator="@interpolator/custom_path_interpolator_favorite"
+ android:propertyName="scaleX"
+ android:repeatCount="-1"
+ android:valueFrom="0"
+ android:valueTo="20" />
+ <objectAnimator
+ android:duration="8000"
+ android:interpolator="@interpolator/custom_path_interpolator_favorite"
+ android:propertyName="scaleY"
+ android:repeatCount="-1"
+ android:valueFrom="0"
+ android:valueTo="20" />
+
+</set> \ 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 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ 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.
+-->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android" >
+
+ <objectAnimator
+ android:duration="3300"
+ android:propertyName="rotation"
+ android:valueFrom="0"
+ android:valueTo="360"
+ android:repeatCount="-1" />
+</set> \ 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 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ 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.
+-->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android" >
+
+ <objectAnimator
+ android:duration="2000"
+ android:interpolator="@interpolator/custom_path_interpolator_favorite"
+ android:propertyName="scaleX"
+ android:repeatCount="-1"
+ android:valueFrom="0"
+ android:valueTo="20" />
+ <objectAnimator
+ android:duration="2000"
+ android:interpolator="@interpolator/custom_path_interpolator_favorite"
+ android:propertyName="scaleY"
+ android:repeatCount="-1"
+ android:valueFrom="0"
+ android:valueTo="20" />
+
+</set> \ 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 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ 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.
+-->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android" >
+
+ <objectAnimator
+ android:duration="1300"
+ android:interpolator="@interpolator/trim_start_interpolator"
+ android:propertyName="trimPathStart"
+ android:repeatCount="-1"
+ android:valueFrom="0"
+ android:valueTo="0.75"
+ android:valueType="floatType" />
+ <objectAnimator
+ android:duration="1300"
+ android:interpolator="@interpolator/trim_end_interpolator"
+ android:propertyName="trimPathEnd"
+ android:repeatCount="-1"
+ android:valueFrom="0"
+ android:valueTo="0.75"
+ android:valueType="floatType" />
+ <objectAnimator
+ android:duration="1300"
+ android:interpolator="@android:anim/linear_interpolator"
+ android:propertyName="trimPathOffset"
+ android:repeatCount="-1"
+ android:valueFrom="0"
+ android:valueTo="1.25"
+ android:valueType="floatType" />
+
+</set> \ 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 @@
<target
android:name="pie1"
android:animation="@anim/trim_path_animation01" />
-
<target
android:name="v"
android:animation="@anim/trim_path_animation02" />
<target
android:name="v"
android:animation="@anim/trim_path_animation05" />
-
<target
android:name="rotationGroup"
android:animation="@anim/trim_path_animation03" />
@@ -40,4 +38,4 @@
android:name="rotationGroup"
android:animation="@anim/trim_path_animation04" />
-</animated-vector>
+</animated-vector> \ 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 @@
+<!--
+ 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-vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:drawable="@drawable/vector_drawable_favorite" >
+
+ <target
+ android:name="favorite"
+ android:animation="@anim/animation_favorite" />
+ <target
+ android:name="root"
+ android:animation="@anim/animation_favorite02" />
+
+</animated-vector> \ 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 @@
+<!--
+ 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-vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:drawable="@drawable/vector_drawable_grouping_1" >
+
+ <target
+ android:name="sun"
+ android:animation="@anim/animation_grouping_1_01" />
+ <target
+ android:name="earth"
+ android:animation="@anim/animation_grouping_1_01" />
+
+</animated-vector> \ 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 @@
+<!--
+ 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-vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:drawable="@drawable/vector_drawable_progress_bar" >
+
+ <target
+ android:name="pie1"
+ android:animation="@anim/trim_path_animation_progress_bar" />
+
+</animated-vector> \ 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 @@
+<!--
+ 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.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android" >
+
+ <size
+ android:height="128dp"
+ android:width="128dp" />
+
+ <viewport
+ android:viewportHeight="480"
+ android:viewportWidth="480" />
+
+ <group
+ android:name="root"
+ android:translateX="240.0"
+ android:translateY="240.0" >
+ <path
+ android:name="favorite"
+ android:fill="#ff000000"
+ android:pathData="M2.100006104,-6
+ C0.1449127197,-6,1.600006104,-5.975006104,0,-5.975006104
+ C-1.574996948,-5.975006104,0.00309753418,-6,-1.949996948,-6
+ C-4.492996216,-6,-5.949996948,-3.718399048,-5.949996948,-1.149993896
+ C-5.949996948,2.379302979,-5.699996948,5.100006104,0,5.100006104
+ C5.699996948,5.100006104,6,2.379302979,6,-1.149993896
+ C6,-3.718399048,4.643005371,-6,2.100006104,-6" />
+ </group>
+
+</vector> \ 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 @@
+<!--
+ 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.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android" >
+
+ <size
+ android:height="64dp"
+ android:width="64dp" />
+
+ <viewport
+ android:viewportHeight="256"
+ android:viewportWidth="256" />
+
+ <group
+ android:name="shape_layer_1"
+ android:translateX="128"
+ android:translateY="128" >
+ <group android:name="sun" >
+ <path
+ android:name="ellipse_path_1"
+ android:fill="#ffff8000"
+ android:pathData="m -25 0 a 25,25 0 1,0 50,0 a 25,25 0 1,0 -50,0" />
+
+ <group
+ android:name="earth"
+ android:translateX="75" >
+ <path
+ android:name="ellipse_path_1_1"
+ android:fill="#ff5656ea"
+ android:pathData="m -10 0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0" />
+
+ <group
+ android:name="moon"
+ android:translateX="25" >
+ <path
+ android:name="ellipse_path_1_2"
+ android:fill="#ffadadad"
+ android:pathData="m -5 0 a 5,5 0 1,0 10,0 a 5,5 0 1,0 -10,0" />
+ </group>
+ </group>
+ </group>
+ </group>
+
+</vector> \ 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 @@
+<!--
+ 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.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android" >
+
+ <size
+ android:height="64dp"
+ android:width="64dp" />
+
+ <viewport
+ android:viewportHeight="64"
+ android:viewportWidth="64" />
+
+ <group
+ android:name="root"
+ android:pivotX="0.0"
+ android:pivotY="0.0"
+ android:rotation="0"
+ android:translateX="32.0"
+ android:translateY="32.0" >
+ <group
+ android:name="rotationGroup"
+ android:pivotX="0.0"
+ android:pivotY="0.0"
+ android:rotation="0" >
+ <path
+ android:name="pie1"
+ android:fill="#00000000"
+ android:pathData="M0, 0 m 0, -9.5 a 9.5,9.5 0 1,1 0,19 a 9.5,9.5 0 1,1 0,-19"
+ android:stroke="#89cff0"
+ android:strokeLineCap="round"
+ android:strokeLineJoin="miter"
+ android:strokeWidth="2"
+ android:trimPathEnd="0.1"
+ android:trimPathOffset="0"
+ android:trimPathStart="0" />
+ </group>
+ </group>
+
+</vector> \ 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 @@
+<pathInterpolator xmlns:android="http://schemas.android.com/apk/res/android"
+ android:pathData="L0.1, 0 C0.10066,0 0.198,1 0.2, 1 L 1,1" /> \ 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 @@
+<pathInterpolator xmlns:android="http://schemas.android.com/apk/res/android"
+ android:pathData="L 0.09 1 L 1,1" /> \ 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 @@
+<pathInterpolator xmlns:android="http://schemas.android.com/apk/res/android"
+ android:pathData="C0.2,0 0.1,1 0.5, 1 L 1,1" /> \ 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 @@
+<pathInterpolator xmlns:android="http://schemas.android.com/apk/res/android"
+ android:pathData="L0.5,0 C 0.7,0 0.6,1 1, 1" /> \ 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 @@
<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
+<!--
+ 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.
@@ -15,12 +16,13 @@
-->
<resources>
- <string name="twoLinePathData" >"M 0,0 v 100 M 0,0 h 100"</string>
- <string name="triangle" > "M300,70 l 0,-70 70,70 0,0 -70,70z"</string>
- <string name="rectangle" >"M300,70 l 0,-70 70,0 0,140 -70,0 z"</string>
+ <string name="twoLinePathData">"M 0,0 v 100 M 0,0 h 100"</string>
+ <string name="triangle"> "M300,70 l 0,-70 70,70 0,0 -70,70z"</string>
+ <string name="rectangle">"M300,70 l 0,-70 70,0 0,140 -70,0 z"</string>
+ <string name="rectangle2">"M300,70 l 0,-70 70,0 0,70z M300,70 l 70,0 0,70 -70,0z"</string>
+ <string name="equal2"> "M300,35 l 0,-35 70,0 0,35z M300,105 l 70,0 0,35 -70,0z"</string>
+ <string name="round_box">"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"</string>
+ <string name="heart"> "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"</string>
- <string name="rectangle2" >"M300,70 l 0,-70 70,0 0,70z M300,70 l 70,0 0,70 -70,0z"</string>
- <string name="equal2" > "M300,35 l 0,-35 70,0 0,35z M300,105 l 70,0 0,35 -70,0z"</string>
-
-</resources>
+</resources> \ 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();
}
}