diff options
author | ztenghui <ztenghui@google.com> | 2014-07-09 10:49:44 -0700 |
---|---|---|
committer | Tenghui Zhu <ztenghui@google.com> | 2014-07-10 22:04:20 +0000 |
commit | 8d0d24f7a2b1a59060aa18926984491691d3c667 (patch) | |
tree | 67d3265ba6cf5c72f2ce50ee2810ccb8f8e18f3c /tests/VectorDrawableTest | |
parent | ef6a8cc008030885f01a39efce6c7aa6b58bbc07 (diff) | |
download | frameworks_base-8d0d24f7a2b1a59060aa18926984491691d3c667.zip frameworks_base-8d0d24f7a2b1a59060aa18926984491691d3c667.tar.gz frameworks_base-8d0d24f7a2b1a59060aa18926984491691d3c667.tar.bz2 |
Fix the render order to follow the XML file order.
So we put path and group into a big list, then use reflectiont to handle them
differently.
bug:16162141
Change-Id: I4c84dc952d5d9b49412301dcd6459395e21d3b31
Diffstat (limited to 'tests/VectorDrawableTest')
3 files changed, 95 insertions, 1 deletions
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable25.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable25.xml new file mode 100644 index 0000000..a3f0447 --- /dev/null +++ b/tests/VectorDrawableTest/res/drawable/vector_drawable25.xml @@ -0,0 +1,93 @@ +<!-- + 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="400" + android:viewportWidth="400" /> + + <group + android:name="FirstLevelGroup" + android:alpha="0.9" + android:translateX="100.0" + android:translateY="0.0" > + <group + android:name="SecondLevelGroup1" + android:alpha="0.9" + android:translateX="-100.0" + android:translateY="50.0" > + <path + android:fill="#FF00FF00" + android:pathData="@string/rectangle200" /> + + <group + android:name="ThridLevelGroup1" + android:alpha="0.9" + android:translateX="-100.0" + android:translateY="50.0" > + <path + android:fill="#FF0000FF" + android:pathData="@string/rectangle200" /> + </group> + <group + android:name="ThridLevelGroup2" + android:alpha="0.8" + android:translateX="100.0" + android:translateY="50.0" > + <path + android:fill="#FF000000" + android:pathData="@string/rectangle200" /> + </group> + </group> + <group + android:name="SecondLevelGroup2" + android:alpha="0.8" + android:translateX="100.0" + android:translateY="50.0" > + <path + android:fill="#FF0000FF" + android:pathData="@string/rectangle200" /> + + <group + android:name="ThridLevelGroup3" + android:alpha="0.9" + android:translateX="-100.0" + android:translateY="50.0" > + <path + android:fill="#FFFF0000" + android:pathData="@string/rectangle200" /> + </group> + <group + android:name="ThridLevelGroup4" + android:alpha="0.8" + android:translateX="100.0" + android:translateY="50.0" > + <path + android:fill="#FF00FF00" + android:pathData="@string/rectangle200" /> + </group> + </group> + + <path + android:fill="#FFFF0000" + android:pathData="@string/rectangle200" /> + </group> + +</vector>
\ No newline at end of file diff --git a/tests/VectorDrawableTest/res/values/strings.xml b/tests/VectorDrawableTest/res/values/strings.xml index 54cffa8..a550549 100644 --- a/tests/VectorDrawableTest/res/values/strings.xml +++ b/tests/VectorDrawableTest/res/values/strings.xml @@ -24,5 +24,5 @@ <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="rectangle200">"M 0,0 l 200,0 l 0, 200 l -200, 0 z"</string> </resources>
\ No newline at end of file diff --git a/tests/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawablePerformance.java b/tests/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawablePerformance.java index 814deb8..e8b6952 100644 --- a/tests/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawablePerformance.java +++ b/tests/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawablePerformance.java @@ -52,6 +52,7 @@ public class VectorDrawablePerformance extends Activity { R.drawable.vector_drawable22, R.drawable.vector_drawable23, R.drawable.vector_drawable24, + R.drawable.vector_drawable25, }; @Override |