Code example for Shape

Methods: draw

0
            @Override protected void onDraw(Shape s, Canvas c, Paint p) {
            	Paint strokePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
                strokePaint.setStyle(Paint.Style.STROKE);
                strokePaint.setColor(strokeColor);
                strokePaint.setStrokeWidth(strokeWidth);
                s.draw(c, p);//先画在画布上
                s.draw(c, strokePaint);//再画边框
            } 
        }; 
       	dr.getPaint().setColor(color);
    	return dr;
    } 
     
    /** 
     * 矩形 
     *  
<shape xmlns:android="http://schemas.android.com/apk/res/android" 
    android:shape="rectangle"> 
    <solid android:color="#FFFF0000"/> 
</shape> 
     */