diff options
author | ztenghui <ztenghui@google.com> | 2014-05-28 15:02:35 -0700 |
---|---|---|
committer | ztenghui <ztenghui@google.com> | 2014-06-02 17:18:10 -0700 |
commit | 4d24caf1dec2babf273b18c99638fe2a0635ced4 (patch) | |
tree | a91badbb5bd40b360737399eacec525c13262e0a /tests/VectorDrawableTest | |
parent | 452f6ece7fe2fd1a85fca53f54e90bf041083b21 (diff) | |
download | frameworks_base-4d24caf1dec2babf273b18c99638fe2a0635ced4.zip frameworks_base-4d24caf1dec2babf273b18c99638fe2a0635ced4.tar.gz frameworks_base-4d24caf1dec2babf273b18c99638fe2a0635ced4.tar.bz2 |
Add the tree hierarchy for the group
bug:15288554
Change-Id: I7caedb8466d078a0d9a6148e00d02eded4a4d234
Diffstat (limited to 'tests/VectorDrawableTest')
4 files changed, 163 insertions, 2 deletions
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable22.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable22.xml new file mode 100644 index 0000000..8d38cb5 --- /dev/null +++ b/tests/VectorDrawableTest/res/drawable/vector_drawable22.xml @@ -0,0 +1,72 @@ +<!-- + 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="backgroundGroup" > + <path + android:name="background1" + android:fill="#80000000" + android:pathData="M 0,0 l 200,0 l 0, 200 l -200, 0 z" /> + <path + android:name="background2" + android:fill="#80000000" + android:pathData="M 200,200 l 200,0 l 0, 200 l -200, 0 z" /> + </group> + <group + android:name="translateToCenterGroup" + android:translateX="50.0" + android:translateY="90.0" > + <path + android:name="twoLines" + android:pathData="M 0,0 v 100 M 0,0 h 100" + android:stroke="#FFFF0000" + android:strokeWidth="20" /> + + <group + android:name="rotationGroup" + android:pivotX="0.0" + android:pivotY="0.0" + android:rotation="-45.0" > + <path + android:name="twoLines1" + android:pathData="M 0,0 v 100 M 0,0 h 100" + android:stroke="#FF00FF00" + android:strokeWidth="20" /> + + <group + android:name="translateGroup" + android:translateX="130.0" + android:translateY="160.0" > + <group android:name="scaleGroup" > + <path + android:name="twoLines2" + android:pathData="M 0,0 v 100 M 0,0 h 100" + android:stroke="#FF0000FF" + android:strokeWidth="20" /> + </group> + </group> + </group> + </group> + +</vector>
\ No newline at end of file diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable23.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable23.xml new file mode 100644 index 0000000..52acd7a --- /dev/null +++ b/tests/VectorDrawableTest/res/drawable/vector_drawable23.xml @@ -0,0 +1,86 @@ +<!-- + 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="backgroundGroup" > + <path + android:name="background1" + android:fill="#80000000" + android:pathData="M 0,0 l 200,0 l 0, 200 l -200, 0 z" /> + <path + android:name="background2" + android:fill="#80000000" + android:pathData="M 200,200 l 200,0 l 0, 200 l -200, 0 z" /> + </group> + <group + android:name="translateToCenterGroup" + android:translateX="50.0" + android:translateY="90.0" > + <path + android:name="twoLines" + android:pathData="@string/twoLinePathData" + android:stroke="#FFFF0000" + android:strokeWidth="20" /> + + <group + android:name="rotationGroup" + android:pivotX="0.0" + android:pivotY="0.0" + android:rotation="-45.0" > + <path + android:name="twoLines1" + android:pathData="@string/twoLinePathData" + android:stroke="#FF00FF00" + android:strokeWidth="20" /> + + <group + android:name="translateGroup" + android:translateX="130.0" + android:translateY="160.0" > + <group android:name="scaleGroup" > + <path + android:name="twoLines3" + android:pathData="@string/twoLinePathData" + android:stroke="#FF0000FF" + android:strokeWidth="20" /> + </group> + </group> + + <group + android:name="translateGroupHalf" + android:translateX="65.0" + android:translateY="80.0" > + <group android:name="scaleGroup" > + <path + android:name="twoLines2" + android:pathData="@string/twoLinePathData" + android:fill="?android:attr/colorForeground" + android:stroke="?android:attr/colorForeground" + android:strokeWidth="20" /> + </group> + </group> + </group> + </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 64163c2..b49a1aa 100644 --- a/tests/VectorDrawableTest/res/values/strings.xml +++ b/tests/VectorDrawableTest/res/values/strings.xml @@ -15,4 +15,5 @@ --> <resources> + <string name="twoLinePathData" >"M 0,0 v 100 M 0,0 h 100"</string> </resources> diff --git a/tests/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawablePerformance.java b/tests/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawablePerformance.java index e0624e5..c2a5e6b 100644 --- a/tests/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawablePerformance.java +++ b/tests/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawablePerformance.java @@ -17,11 +17,11 @@ import android.app.Activity; import android.content.res.Resources; import android.graphics.drawable.VectorDrawable; import android.os.Bundle; -import android.view.View; import android.widget.TextView; import android.widget.Button; import android.widget.GridLayout; import android.widget.ScrollView; + import java.text.DecimalFormat; @SuppressWarnings({"UnusedDeclaration"}) @@ -48,7 +48,9 @@ public class VectorDrawablePerformance extends Activity { R.drawable.vector_drawable18, R.drawable.vector_drawable19, R.drawable.vector_drawable20, - R.drawable.vector_drawable21 + R.drawable.vector_drawable21, + R.drawable.vector_drawable22, + R.drawable.vector_drawable23 }; @Override |