diff options
author | ztenghui <ztenghui@google.com> | 2014-06-03 18:07:31 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-06-03 18:07:31 +0000 |
commit | a8cb975aa7c91d0330ac6589884ea9adb3022bc1 (patch) | |
tree | 79f2b5381c41b96d2d420d7c6331f1c72686c9a8 /tests | |
parent | b656270e8ede6b81020ea493fd3a8d8958bf8438 (diff) | |
parent | 2af745b56cf4bdfdd9c05d90a4ccc740bf77a4fe (diff) | |
download | frameworks_base-a8cb975aa7c91d0330ac6589884ea9adb3022bc1.zip frameworks_base-a8cb975aa7c91d0330ac6589884ea9adb3022bc1.tar.gz frameworks_base-a8cb975aa7c91d0330ac6589884ea9adb3022bc1.tar.bz2 |
Merge "Handle the alpha in the group setting and fix the fill issue."
Diffstat (limited to 'tests')
11 files changed, 108 insertions, 3 deletions
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable06.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable06.xml index 850de28..ab5f7f4 100644 --- a/tests/VectorDrawableTest/res/drawable/vector_drawable06.xml +++ b/tests/VectorDrawableTest/res/drawable/vector_drawable06.xml @@ -25,10 +25,12 @@ <group> <path android:pathData="M 569.374 461.472L 569.374 160.658L 160.658 160.658L 160.658 461.472L 569.374 461.472z" android:name="path2451" + android:fill="#00000000" android:stroke="#FF000000" android:strokeWidth="30.65500000000000"/> <path android:pathData="M 365.015 311.066" android:name="path2453" + android:fill="#00000000" android:stroke="#FF000000" android:strokeWidth="30.655000000000001"/> <path android:pathData="M 164.46 164.49L 340.78 343.158C 353.849 356.328 377.63 356.172 390.423 343.278L 566.622 165.928" @@ -38,10 +40,12 @@ android:strokeWidth="30.655000000000001"/> <path android:pathData="M 170.515 451.566L 305.61 313.46" android:name="path2457" + android:fill="#00000000" android:stroke="#000000" android:strokeWidth="30.655000000000001"/> <path android:pathData="M 557.968 449.974L 426.515 315.375" android:name="path2459" + android:fill="#00000000" android:stroke="#000000" android:strokeWidth="30.655000000000001"/> </group> diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable12.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable12.xml index d0edd8c..3042f6a 100644 --- a/tests/VectorDrawableTest/res/drawable/vector_drawable12.xml +++ b/tests/VectorDrawableTest/res/drawable/vector_drawable12.xml @@ -27,6 +27,7 @@ <path android:name="pie1" android:pathData="M300,70 a230,230 0 1,0 1,0 z" + android:fill="#00000000" android:stroke="#FF00FF00" android:strokeWidth="70" android:trimPathEnd=".75" diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable14.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable14.xml index 1abe1e1..8d4ca61 100644 --- a/tests/VectorDrawableTest/res/drawable/vector_drawable14.xml +++ b/tests/VectorDrawableTest/res/drawable/vector_drawable14.xml @@ -34,6 +34,7 @@ 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:fill="#00000000" 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 8e98d02..c28aff4 100644 --- a/tests/VectorDrawableTest/res/drawable/vector_drawable17.xml +++ b/tests/VectorDrawableTest/res/drawable/vector_drawable17.xml @@ -25,6 +25,7 @@ <path android:name="house" android:pathData="M200,300 Q400,50 600,300 T1000,300" + android:fill="#00000000" android:stroke="#FFFF0000" android:strokeWidth="10"/> </group> diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable18.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable18.xml index 6d74ebd..d7042fd 100644 --- a/tests/VectorDrawableTest/res/drawable/vector_drawable18.xml +++ b/tests/VectorDrawableTest/res/drawable/vector_drawable18.xml @@ -27,6 +27,7 @@ <path android:name="house" android:pathData="M100,200 C100,100 250,100 250,200 S400,300 400,200" + android:fill="#00000000" android:stroke="#FFFFFF00" android:strokeWidth="10" /> </group> diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable19.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable19.xml index a890fd6..47a9574 100644 --- a/tests/VectorDrawableTest/res/drawable/vector_drawable19.xml +++ b/tests/VectorDrawableTest/res/drawable/vector_drawable19.xml @@ -29,6 +29,7 @@ android:pathData="M10,300 Q400,550 600,300 T1000,300" android:pivotX="90" android:pivotY="100" + android:fill="#00000000" android:stroke="#FFFF0000" android:strokeWidth="60" /> </group> diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable24.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable24.xml new file mode 100644 index 0000000..c062d70 --- /dev/null +++ b/tests/VectorDrawableTest/res/drawable/vector_drawable24.xml @@ -0,0 +1,91 @@ +<!-- + 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" + android:alpha = "0.5" > + <path + android:name="background1" + android:fill="#FF000000" + android:pathData="M 0,0 l 200,0 l 0, 200 l -200, 0 z" /> + <path + android:name="background2" + android:fill="#FF000000" + 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" + android:alpha = "0.5" > + <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" + android:alpha = "0.5" > + <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" + android:alpha = "0.5"> + <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" + android:alpha = "0.5"> + <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/drawable/vector_test01.xml b/tests/VectorDrawableTest/res/drawable/vector_test01.xml index a9091ab..fc2a15c 100644 --- a/tests/VectorDrawableTest/res/drawable/vector_test01.xml +++ b/tests/VectorDrawableTest/res/drawable/vector_test01.xml @@ -28,7 +28,8 @@ limitations under the License. android:name="002b" android:pathData="M100,200c0,-100 150,-100 150,0s150,100 150,0t-200,299" android:stroke="#FF0000FF" - android:strokeWidth="4" /> + android:strokeWidth="4" + android:fill="#00000000" /> </group> </vector>
\ No newline at end of file diff --git a/tests/VectorDrawableTest/res/drawable/vector_test02.xml b/tests/VectorDrawableTest/res/drawable/vector_test02.xml index ab58c06..9f4abbf 100644 --- a/tests/VectorDrawableTest/res/drawable/vector_test02.xml +++ b/tests/VectorDrawableTest/res/drawable/vector_test02.xml @@ -28,7 +28,8 @@ limitations under the License. android:name="002b" android:pathData="M100,200c0,-100 150,-100 150,0s150,100 150,0T-200,299" android:stroke="#FF0000FF" - android:strokeWidth="4" /> + android:strokeWidth="4" + android:fill="#00000000" /> </group> </vector>
\ No newline at end of file diff --git a/tests/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawable01.java b/tests/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawable01.java index 7ba01b1..a23d819 100644 --- a/tests/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawable01.java +++ b/tests/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawable01.java @@ -61,6 +61,8 @@ public class VectorDrawable01 extends Activity { button.setWidth(200); button.setBackgroundResource(icon[i]); container.addView(button); + VectorDrawable vd = (VectorDrawable) button.getBackground(); + vd.setAlpha((i + 1) * (0xFF / (icon.length + 1))); } setContentView(container); diff --git a/tests/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawablePerformance.java b/tests/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawablePerformance.java index c2a5e6b..814deb8 100644 --- a/tests/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawablePerformance.java +++ b/tests/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawablePerformance.java @@ -50,7 +50,8 @@ public class VectorDrawablePerformance extends Activity { R.drawable.vector_drawable20, R.drawable.vector_drawable21, R.drawable.vector_drawable22, - R.drawable.vector_drawable23 + R.drawable.vector_drawable23, + R.drawable.vector_drawable24, }; @Override |