diff options
author | ztenghui <ztenghui@google.com> | 2014-05-27 10:42:15 -0700 |
---|---|---|
committer | ztenghui <ztenghui@google.com> | 2014-05-28 09:31:19 -0700 |
commit | 63cfd85bcce488a3f3952bd1db523a727d30ca39 (patch) | |
tree | 9ad6bf61886785aa85047b38b13467225291b613 /tests/VectorDrawableTest | |
parent | 69170a56c600b993bc1116d71d0b9d38fbaf1d7a (diff) | |
download | frameworks_base-63cfd85bcce488a3f3952bd1db523a727d30ca39.zip frameworks_base-63cfd85bcce488a3f3952bd1db523a727d30ca39.tar.gz frameworks_base-63cfd85bcce488a3f3952bd1db523a727d30ca39.tar.bz2 |
Move the rotation information from path to group.
Also update the 3rd test to correctly testing clipping.
Removing some naive tests which rotate 360 or 0.
bug:15288554
Change-Id: I436e8e494cb78fc665a3890171a1af87367db419
Diffstat (limited to 'tests/VectorDrawableTest')
11 files changed, 73 insertions, 82 deletions
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable02.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable02.xml index db5697c..40f23f0 100644 --- a/tests/VectorDrawableTest/res/drawable/vector_drawable02.xml +++ b/tests/VectorDrawableTest/res/drawable/vector_drawable02.xml @@ -15,21 +15,22 @@ <vector xmlns:android="http://schemas.android.com/apk/res/android" > <size - android:width="64dp" - android:height="64dp"/> + android:width="64dp" + android:height="64dp"/> <viewport android:viewportWidth="320" android:viewportHeight="320"/> - - <path + <group + android:rotation="180" + android:pivotX="70" + android:pivotY="120"> + <path android:name="house" android:pathData="M 130,225 L 130,115 L 130,115 L 70,15 L 10,115 L 10,115 L 10,225 z" android:fill="#ff440000" android:stroke="#FF00FF00" android:strokeWidth="10" - android:rotation="180" - android:pivotX="70" - android:pivotY="120" android:trimPathStart=".1" android:trimPathEnd=".9"/> + </group> </vector> diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable03.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable03.xml index 8e8250d9..5b4c4ab 100644 --- a/tests/VectorDrawableTest/res/drawable/vector_drawable03.xml +++ b/tests/VectorDrawableTest/res/drawable/vector_drawable03.xml @@ -1,4 +1,5 @@ -<!-- 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,57 +16,62 @@ <vector xmlns:android="http://schemas.android.com/apk/res/android" > <size - android:width="64dp" - android:height="64dp"/> + android:height="64dp" + android:width="64dp" /> <viewport - android:viewportWidth="7.30625" - android:viewportHeight="12.25"/> + android:viewportHeight="12.25" + android:viewportWidth="7.30625" /> - <path + <group + android:pivotX="3.65" + android:pivotY="6.125" + android:rotation="-30" > + <path android:name="clip1" - android:pathData=" - M 0, 0 - l 7.3, 0 - l 0, 0 - l -7.3, 0 - z" android:clipToPath="true" - android:rotation="-30" - android:pivotX="3.65" - android:pivotY="6.125" - /> - <path + android:pathData=" + M 0, 6.125 + l 7.3, 0 + l 0, 12.25 + l -7.3, 0 + z" /> + </group> + <group> + <path android:name="one" - android:pathData="M 1.215625,9.5l 1.9375,0.0 0.0,-6.671875 -2.109375,0.421875 0.0,-1.078125 - l 2.09375,-0.421875 1.1874998,0.0 0.0,7.75 1.9375,0.0 0.0,1.0 - l -5.046875,0.0 0.0,-1.0Z" android:fill="#ff88ff" - /> - <path + android:pathData="M 1.215625,9.5l 1.9375,0.0 0.0,-6.671875 -2.109375,0.421875 0.0,-1.078125 + l 2.09375,-0.421875 1.1874998,0.0 0.0,7.75 1.9375,0.0 0.0,1.0 + l -5.046875,0.0 0.0,-1.0Z" /> + </group> + <group + android:pivotX="3.65" + android:pivotY="6.125" + android:rotation="-30" > + <path android:name="clip2" - android:pathData=" - M 0, 0 - l 7.3, 0 - l 0, 12.25 - l -7.3, 0 - z" android:clipToPath="true" - android:rotation="-30" - android:pivotX="3.65" - android:pivotY="6.125" - /> - <path + android:pathData=" + M 0, 0 + l 7.3, 0 + l 0, 6.125 + l -7.3, 0 + z" /> + </group> + <group> + <path android:name="two" - android:pathData="M 2.534375,9.6875l 4.140625,0.0 0.0,1.0 -5.5625,0.0 0.0,-1.0q 0.671875,-0.6875 1.828125,-1.859375 - q 1.1718752,-1.1875 1.4687502,-1.53125 0.578125,-0.625 0.796875,-1.0625 - q 0.234375,-0.453125 0.234375,-0.875 0.0,-0.703125 -0.5,-1.140625 - q -0.484375,-0.4375 -1.2656252,-0.4375 -0.5625,0.0 -1.1875,0.1875 - q -0.609375,0.1875 -1.3125,0.59375l 0.0,-1.203125q 0.71875,-0.28125 1.328125,-0.421875 - q 0.625,-0.15625 1.140625,-0.15625 1.3593752,0.0 2.1718752,0.6875 - q 0.8125,0.671875 0.8125,1.8125 0.0,0.53125 -0.203125,1.015625 - q -0.203125,0.484375 -0.734375,1.140625 -0.15625,0.171875 -0.9375,0.984375 - q -0.78125024,0.8125 -2.2187502,2.265625Z" android:fill="#ff88ff" - /> -</vector> + android:pathData="M 2.534375,9.6875l 4.140625,0.0 0.0,1.0 -5.5625,0.0 0.0,-1.0q 0.671875,-0.6875 1.828125,-1.859375 + q 1.1718752,-1.1875 1.4687502,-1.53125 0.578125,-0.625 0.796875,-1.0625 + q 0.234375,-0.453125 0.234375,-0.875 0.0,-0.703125 -0.5,-1.140625 + q -0.484375,-0.4375 -1.2656252,-0.4375 -0.5625,0.0 -1.1875,0.1875 + q -0.609375,0.1875 -1.3125,0.59375l 0.0,-1.203125q 0.71875,-0.28125 1.328125,-0.421875 + q 0.625,-0.15625 1.140625,-0.15625 1.3593752,0.0 2.1718752,0.6875 + q 0.8125,0.671875 0.8125,1.8125 0.0,0.53125 -0.203125,1.015625 + q -0.203125,0.484375 -0.734375,1.140625 -0.15625,0.171875 -0.9375,0.984375 + q -0.78125024,0.8125 -2.2187502,2.265625Z" /> + </group> + +</vector>
\ No newline at end of file diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable09.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable09.xml index 2e379d6..c93c85f 100644 --- a/tests/VectorDrawableTest/res/drawable/vector_drawable09.xml +++ b/tests/VectorDrawableTest/res/drawable/vector_drawable09.xml @@ -23,14 +23,14 @@ android:viewportHeight="200" android:viewportWidth="200" /> - <group> + <group + android:pivotX="100" + android:pivotY="100" + android:rotation="90"> <path android:name="house" android:fill="#ffffffff" - android:pathData="M 100,20 l 0,0 0,140 -80,0 z M 100,20 l 0,0 80,140 -80,0 z" - android:pivotX="100" - android:pivotY="100" - android:rotation="90" /> + android:pathData="M 100,20 l 0,0 0,140 -80,0 z M 100,20 l 0,0 80,140 -80,0 z"/> </group> </vector>
\ No newline at end of file diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable11.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable11.xml index 2b6c5d3..3422bbf 100644 --- a/tests/VectorDrawableTest/res/drawable/vector_drawable11.xml +++ b/tests/VectorDrawableTest/res/drawable/vector_drawable11.xml @@ -28,7 +28,6 @@ android:name="battery" android:fill="#3388ff" android:pathData="M 20.28125,2.0000002 C 17.352748,2.0000002 15,4.3527485 15,7.2812502 L 15,8.0000002 L 13.15625,8.0000002 C 9.7507553,8.0000002 7,10.750759 7,14.15625 L 7,39.84375 C 7,43.24924 9.7507558,46 13.15625,46 L 33.84375,46 C 37.249245,46 39.999999,43.24924 40,39.84375 L 40,14.15625 C 40,10.75076 37.249243,8.0000002 33.84375,8.0000002 L 32,8.0000002 L 32,7.2812502 C 32,4.3527485 29.647252,2.0000002 26.71875,2.0000002 L 20.28125,2.0000002 z" - android:rotation="0" android:stroke="#ff8833" android:strokeWidth="1" /> <path diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable12.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable12.xml index 681eb4f..d0edd8c 100644 --- a/tests/VectorDrawableTest/res/drawable/vector_drawable12.xml +++ b/tests/VectorDrawableTest/res/drawable/vector_drawable12.xml @@ -35,10 +35,7 @@ <path android:name="v" android:fill="#FF00FF00" - android:pathData="M300,70 l 0,-70 70,70 -70,70z" - android:pivotX="300" - android:pivotY="300" - android:rotation="0" /> + android:pathData="M300,70 l 0,-70 70,70 -70,70z"/> </group> </vector>
\ No newline at end of file diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable13.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable13.xml index ef1b8e4..8c946df 100644 --- a/tests/VectorDrawableTest/res/drawable/vector_drawable13.xml +++ b/tests/VectorDrawableTest/res/drawable/vector_drawable13.xml @@ -34,9 +34,6 @@ android:name="half" android:fill="#FFFF0000" android:pathData="M275,175 v-150 a150,150 0 0,0 -150,150 z" - android:pivotX="300" - android:pivotY="200" - android:rotation="0" android:stroke="#FF0000FF" android:strokeWidth="5" /> </group> diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable14.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable14.xml index 77bf723..1abe1e1 100644 --- a/tests/VectorDrawableTest/res/drawable/vector_drawable14.xml +++ b/tests/VectorDrawableTest/res/drawable/vector_drawable14.xml @@ -23,7 +23,10 @@ android:viewportHeight="500" android:viewportWidth="800" /> - <group> + <group + android:pivotX="90" + android:pivotY="100" + android:rotation="20"> <path android:name="pie2" android:pathData="M200,350 l 50,-25 @@ -31,9 +34,6 @@ a25,25 -30 0,1 100,-50 l 50,-25 a25,37 -30 0,1 100,-50 l 50,-25 a25,50 -30 0,1 100,-50 l 50,-25" - android:pivotX="90" - android:pivotY="100" - android:rotation="20" android:stroke="#FF00FF00" android:strokeWidth="10" /> </group> diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable15.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable15.xml index df5838c..b08e157 100644 --- a/tests/VectorDrawableTest/res/drawable/vector_drawable15.xml +++ b/tests/VectorDrawableTest/res/drawable/vector_drawable15.xml @@ -23,14 +23,14 @@ android:viewportHeight="400" android:viewportWidth="500" /> - <group> + <group + android:pivotX="250" + android:pivotY="200" + android:rotation="180"> <path android:name="house" android:fill="#ff440000" android:pathData="M100,200 C100,100 250,100 250,200 S400,300 400,200" - android:pivotX="250" - android:pivotY="200" - android:rotation="180" android:stroke="#FFFF0000" android:strokeWidth="10" /> </group> diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable16.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable16.xml index 0bdcda5..bbff833 100644 --- a/tests/VectorDrawableTest/res/drawable/vector_drawable16.xml +++ b/tests/VectorDrawableTest/res/drawable/vector_drawable16.xml @@ -27,9 +27,6 @@ <path android:name="house" android:pathData="M 100,10 v 90 M 10,100 h 90" - android:pivotX="100" - android:pivotY="100" - android:rotation="360" android:stroke="#FF00FF00" android:strokeWidth="10" /> </group> diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable17.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable17.xml index 4453ae4..8e98d02 100644 --- a/tests/VectorDrawableTest/res/drawable/vector_drawable17.xml +++ b/tests/VectorDrawableTest/res/drawable/vector_drawable17.xml @@ -26,10 +26,7 @@ android:name="house" android:pathData="M200,300 Q400,50 600,300 T1000,300" android:stroke="#FFFF0000" - android:strokeWidth="10" - android:rotation="360" - android:pivotX="600" - android:pivotY="300"/> + android:strokeWidth="10"/> </group> </vector> diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable18.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable18.xml index dfae9ac..6d74ebd 100644 --- a/tests/VectorDrawableTest/res/drawable/vector_drawable18.xml +++ b/tests/VectorDrawableTest/res/drawable/vector_drawable18.xml @@ -27,9 +27,6 @@ <path android:name="house" android:pathData="M100,200 C100,100 250,100 250,200 S400,300 400,200" - android:pivotX="250" - android:pivotY="200" - android:rotation="360" android:stroke="#FFFFFF00" android:strokeWidth="10" /> </group> |