FileDocCategorySizeDatePackage
RectShape.javaAPI DocAndroid 5.1 API1983Thu Mar 12 22:22:30 GMT 2015android.graphics.drawable.shapes

RectShape

public class RectShape extends Shape
Defines a rectangle shape. The rectangle can be drawn to a Canvas with its own draw() method, but more graphical control is available if you instead pass the RectShape to a {@link android.graphics.drawable.ShapeDrawable}.

Fields Summary
private android.graphics.RectF
mRect
Constructors Summary
public RectShape()


      
Methods Summary
public android.graphics.drawable.shapes.RectShapeclone()

        final RectShape shape = (RectShape) super.clone();
        shape.mRect = new RectF(mRect);
        return shape;
    
public voiddraw(android.graphics.Canvas canvas, android.graphics.Paint paint)

        canvas.drawRect(mRect, paint);
    
public voidgetOutline(android.graphics.Outline outline)

        final RectF rect = rect();
        outline.setRect((int) Math.ceil(rect.left), (int) Math.ceil(rect.top),
                (int) Math.floor(rect.right), (int) Math.floor(rect.bottom));
    
protected voidonResize(float width, float height)

        mRect.set(0, 0, width, height);
    
protected final android.graphics.RectFrect()
Returns the RectF that defines this rectangle's bounds.

        return mRect;