Add dither XML attribute support to Gradient and ShapeDrawable.
Change-Id: I4b60a0ba6766b7e7b176e78dc7f15f8467e2b890
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user