From 2af745b56cf4bdfdd9c05d90a4ccc740bf77a4fe Mon Sep 17 00:00:00 2001 From: ztenghui Date: Fri, 30 May 2014 16:23:47 -0700 Subject: Handle the alpha in the group setting and fix the fill issue. The fill used to be dafault as "none". Now it is default to opaque black, which is consistent with svg now. So it is better to always set the fill value. bug:15288554 Change-Id: I07ac41c5adc77665e66e52f2c0220139586fb09b --- .../res/drawable/vector_drawable06.xml | 4 + .../res/drawable/vector_drawable12.xml | 1 + .../res/drawable/vector_drawable14.xml | 1 + .../res/drawable/vector_drawable17.xml | 1 + .../res/drawable/vector_drawable18.xml | 1 + .../res/drawable/vector_drawable19.xml | 1 + .../res/drawable/vector_drawable24.xml | 91 ++++++++++++++++++++++ .../res/drawable/vector_test01.xml | 3 +- .../res/drawable/vector_test02.xml | 3 +- .../com/android/test/dynamic/VectorDrawable01.java | 2 + .../test/dynamic/VectorDrawablePerformance.java | 3 +- 11 files changed, 108 insertions(+), 3 deletions(-) create mode 100644 tests/VectorDrawableTest/res/drawable/vector_drawable24.xml (limited to 'tests') 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 @@ 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 @@ 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 @@ 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 @@ 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" /> 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 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ 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" /> \ 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" /> \ 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 -- cgit v1.1