diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index d9eccd6f27297..b48adf136286e 100755 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -3176,7 +3176,10 @@ + + @@ -3209,6 +3213,7 @@ + @@ -3217,12 +3222,21 @@ + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3317,6 +3383,7 @@ + @@ -3475,6 +3542,8 @@ + + diff --git a/graphics/java/android/graphics/drawable/GradientDrawable.java b/graphics/java/android/graphics/drawable/GradientDrawable.java index 2089751996228..33f050c40028e 100644 --- a/graphics/java/android/graphics/drawable/GradientDrawable.java +++ b/graphics/java/android/graphics/drawable/GradientDrawable.java @@ -624,6 +624,8 @@ public class GradientDrawable extends Drawable { int shapeType = a.getInt( com.android.internal.R.styleable.GradientDrawable_shape, RECTANGLE); + boolean dither = a.getBoolean( + com.android.internal.R.styleable.GradientDrawable_dither, false); if (shapeType == RING) { st.mInnerRadius = a.getDimensionPixelSize( @@ -645,10 +647,11 @@ public class GradientDrawable extends Drawable { a.recycle(); setShape(shapeType); - + setDither(dither); + int type; - final int innerDepth = parser.getDepth()+1; + final int innerDepth = parser.getDepth() + 1; int depth; while ((type=parser.next()) != XmlPullParser.END_DOCUMENT && ((depth=parser.getDepth()) >= innerDepth diff --git a/graphics/java/android/graphics/drawable/ShapeDrawable.java b/graphics/java/android/graphics/drawable/ShapeDrawable.java index cb8774ddf874c..4445b6a8636e9 100644 --- a/graphics/java/android/graphics/drawable/ShapeDrawable.java +++ b/graphics/java/android/graphics/drawable/ShapeDrawable.java @@ -286,7 +286,7 @@ public class ShapeDrawable extends Drawable { protected boolean inflateTag(String name, Resources r, XmlPullParser parser, AttributeSet attrs) { - if (name.equals("padding")) { + if ("padding".equals(name)) { TypedArray a = r.obtainAttributes(attrs, com.android.internal.R.styleable.ShapeDrawablePadding); setPadding( @@ -315,7 +315,10 @@ public class ShapeDrawable extends Drawable { int color = mShapeState.mPaint.getColor(); color = a.getColor(com.android.internal.R.styleable.ShapeDrawable_color, color); mShapeState.mPaint.setColor(color); - + + boolean dither = a.getBoolean(com.android.internal.R.styleable.ShapeDrawable_dither, false); + mShapeState.mPaint.setDither(dither); + setIntrinsicWidth((int) a.getDimension(com.android.internal.R.styleable.ShapeDrawable_width, 0f)); setIntrinsicHeight((int)