Ejemplo n.º 1
0
 @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;
 }
Ejemplo n.º 2
0
 /** Sets the Shape of this ShapeDrawable. */
 public void setShape(Shape s) {
   mShapeState.mShape = s;
   updateShape();
 }
Ejemplo n.º 3
0
  /**
   * 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;
  }