Code example for ShapeDrawable

Methods: draw

0
 
    @Override 
    protected void onDraw(Canvas canvas)
    { 
        if (drawable != null)
            drawable.draw(canvas);
    } 
 
    public int getColor() 
    { 
        return drawable.getPaint().getColor();
    } 
 
    public void setColor(int color)
    { 
        drawable.getPaint().setColor(color);
        invalidate();
    } 
}