From f143ae8ffecc46008b9f6a9fa85d77324b5a145b Mon Sep 17 00:00:00 2001 From: ztenghui Date: Thu, 7 Aug 2014 09:29:39 -0700 Subject: [PATCH] Removing fill and stroke opacity bug:16850076 attrs/public.xml update will be separated for build break friday. Change-Id: I5863193d5fecd7e210bd6db5294868f1a70e0d2f --- api/current.txt | 2 - core/res/res/drawable/ic_corp_icon_badge.xml | 10 ++-- core/res/res/values/attrs.xml | 4 +- .../graphics/drawable/VectorDrawable.java | 48 ++----------------- .../res/drawable/vector_drawable05.xml | 3 +- .../res/drawable/vector_icon_schedule.xml | 4 +- 6 files changed, 12 insertions(+), 59 deletions(-) diff --git a/api/current.txt b/api/current.txt index e48abe2074557..5710415693ee1 100644 --- a/api/current.txt +++ b/api/current.txt @@ -590,7 +590,6 @@ package android { field public static final int fillBefore = 16843196; // 0x10101bc field public static final int fillColor = 16843807; // 0x101041f field public static final int fillEnabled = 16843343; // 0x101024f - field public static final int fillOpacity = 16843806; // 0x101041e field public static final int fillViewport = 16843130; // 0x101017a field public static final int filter = 16843035; // 0x101011b field public static final int filterTouchesWhenObscured = 16843460; // 0x10102c4 @@ -1190,7 +1189,6 @@ package android { field public static final int strokeLineCap = 16843815; // 0x1010427 field public static final int strokeLineJoin = 16843816; // 0x1010428 field public static final int strokeMiterLimit = 16843817; // 0x1010429 - field public static final int strokeOpacity = 16843810; // 0x1010422 field public static final int strokeWidth = 16843811; // 0x1010423 field public static final int submitBackground = 16843914; // 0x101048a field public static final int subtitle = 16843473; // 0x10102d1 diff --git a/core/res/res/drawable/ic_corp_icon_badge.xml b/core/res/res/drawable/ic_corp_icon_badge.xml index d20c43133c56a..834ae68f57df4 100644 --- a/core/res/res/drawable/ic_corp_icon_badge.xml +++ b/core/res/res/drawable/ic_corp_icon_badge.xml @@ -20,13 +20,11 @@ Copyright (C) 2014 The Android Open Source Project android:viewportHeight="64.0"> + android:fillColor="#33000000" + android:pathData="M49.062,50.0m-14.0,0.0a14.0,14.0 0.0,1.0 1.0,28.0 0.0a14.0,14.0 0.0,1.0 1.0,-28.0 0.0"/> + android:fillColor="#33000000" + android:pathData="M49.0,49.5m-14.0,0.0a14.0,14.0 0.0,1.0 1.0,28.0 0.0a14.0,14.0 0.0,1.0 1.0,-28.0 0.0"/> diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index 771690e12b705..736f1a9d213a4 100644 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -5208,13 +5208,13 @@ - + - + diff --git a/graphics/java/android/graphics/drawable/VectorDrawable.java b/graphics/java/android/graphics/drawable/VectorDrawable.java index 813797fd48188..2b5823e83cb28 100644 --- a/graphics/java/android/graphics/drawable/VectorDrawable.java +++ b/graphics/java/android/graphics/drawable/VectorDrawable.java @@ -104,6 +104,8 @@ import java.util.Stack; *
android:translateY
*
The amount of translation on the Y coordinate. * This is defined in the viewport space.
+ *
android:alpha
+ *
The amount of transparency.
* * * @@ -117,15 +119,11 @@ import java.util.Stack; *
Defines path string. This is using exactly same format as "d" attribute * in the SVG's path data. This is defined in the viewport space.
*
android:fillColor
- *
Defines the color to fill the path (none if not present).
+ *
Defines the color to fill the path (black if not present).
*
android:strokeColor
*
Defines the color to draw the path outline (none if not present).
*
android:strokeWidth
*
The width a path stroke.
- *
android:strokeOpacity
- *
The opacity of a path stroke.
- *
android:fillOpacity
- *
The opacity to fill the path with.
*
android:trimPathStart
*
The fraction of the path to trim from the start, in the range from 0 to 1.
*
android:trimPathEnd
@@ -1241,10 +1239,8 @@ public class VectorDrawable extends Drawable { int mStrokeColor = 0; float mStrokeWidth = 0; - float mStrokeOpacity = Float.NaN; int mFillColor = Color.BLACK; int mFillRule; - float mFillOpacity = Float.NaN; float mTrimPathStart = 0; float mTrimPathEnd = 1; float mTrimPathOffset = 0; @@ -1263,10 +1259,8 @@ public class VectorDrawable extends Drawable { mStrokeColor = copy.mStrokeColor; mStrokeWidth = copy.mStrokeWidth; - mStrokeOpacity = copy.mStrokeOpacity; mFillColor = copy.mFillColor; mFillRule = copy.mFillRule; - mFillOpacity = copy.mFillOpacity; mTrimPathStart = copy.mTrimPathStart; mTrimPathEnd = copy.mTrimPathEnd; mTrimPathOffset = copy.mTrimPathOffset; @@ -1327,8 +1321,6 @@ public class VectorDrawable extends Drawable { mFillColor = a.getColor(R.styleable.VectorDrawablePath_fillColor, mFillColor); - mFillOpacity = a.getFloat(R.styleable.VectorDrawablePath_fillOpacity, - mFillOpacity); mStrokeLineCap = getStrokeLineCap(a.getInt( R.styleable.VectorDrawablePath_strokeLineCap, -1), mStrokeLineCap); mStrokeLineJoin = getStrokeLineJoin(a.getInt( @@ -1337,8 +1329,6 @@ public class VectorDrawable extends Drawable { R.styleable.VectorDrawablePath_strokeMiterLimit, mStrokeMiterlimit); mStrokeColor = a.getColor(R.styleable.VectorDrawablePath_strokeColor, mStrokeColor); - mStrokeOpacity = a.getFloat(R.styleable.VectorDrawablePath_strokeOpacity, - mStrokeOpacity); mStrokeWidth = a.getFloat(R.styleable.VectorDrawablePath_strokeWidth, mStrokeWidth); mTrimPathEnd = a.getFloat(R.styleable.VectorDrawablePath_trimPathEnd, @@ -1347,8 +1337,6 @@ public class VectorDrawable extends Drawable { R.styleable.VectorDrawablePath_trimPathOffset, mTrimPathOffset); mTrimPathStart = a.getFloat( R.styleable.VectorDrawablePath_trimPathStart, mTrimPathStart); - - updateColorAlphas(); } @Override @@ -1363,16 +1351,6 @@ public class VectorDrawable extends Drawable { a.recycle(); } - private void updateColorAlphas() { - if (!Float.isNaN(mFillOpacity)) { - mFillColor = applyAlpha(mFillColor, mFillOpacity); - } - - if (!Float.isNaN(mStrokeOpacity)) { - mStrokeColor = applyAlpha(mStrokeColor, mStrokeOpacity); - } - } - /* Setters and Getters, used by animator from AnimatedVectorDrawable. */ @SuppressWarnings("unused") int getStroke() { @@ -1394,16 +1372,6 @@ public class VectorDrawable extends Drawable { mStrokeWidth = strokeWidth; } - @SuppressWarnings("unused") - float getStrokeOpacity() { - return mStrokeOpacity; - } - - @SuppressWarnings("unused") - void setStrokeOpacity(float strokeOpacity) { - mStrokeOpacity = strokeOpacity; - } - @SuppressWarnings("unused") int getFill() { return mFillColor; @@ -1414,16 +1382,6 @@ public class VectorDrawable extends Drawable { mFillColor = fillColor; } - @SuppressWarnings("unused") - float getFillOpacity() { - return mFillOpacity; - } - - @SuppressWarnings("unused") - void setFillOpacity(float fillOpacity) { - mFillOpacity = fillOpacity; - } - @SuppressWarnings("unused") float getTrimPathStart() { return mTrimPathStart; diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable05.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable05.xml index 5b1f6abba3d3d..bbf1a17d35b1a 100644 --- a/tests/VectorDrawableTest/res/drawable/vector_drawable05.xml +++ b/tests/VectorDrawableTest/res/drawable/vector_drawable05.xml @@ -28,8 +28,7 @@ l-5.046875,0.0 0.0-1.0Z" />