@Override public Drawable mutate() { if (!mMutated && super.mutate() == this) { mShapeState.mPaint = new Paint(mShapeState.mPaint); mShapeState.mPadding = new Rect(mShapeState.mPadding); try { mShapeState.mShape = mShapeState.mShape.clone(); } catch (CloneNotSupportedException e) { return null; } mMutated = true; } return this; }
/** Sets the Shape of this ShapeDrawable. */ public void setShape(Shape s) { mShapeState.mShape = s; updateShape(); }
/** * Creates a ShapeDrawable with a specified Shape. * * @param s the Shape that this ShapeDrawable should be */ public ShapeDrawable(Shape s) { this((ShapeState) null); mShapeState.mShape = s; }