Code example for Paint

Methods: setColor, setMaskFilter, setStrokeWidth, setStyle

0
	 *           blur size, if > 0 create a blur mask around the circle 
	 */ 
	public GalleryCircleDrawable( float radius, int blur_size ) {
		super(); 
 
		mPaint = new Paint( Paint.ANTI_ALIAS_FLAG );
		mPaint.setStrokeWidth( mStrokeWidth );
		mPaint.setStyle( Paint.Style.STROKE );
		mPaint.setColor( Color.WHITE );
 
		mShadowPaint = new Paint( mPaint );
		mShadowPaint.setColor( Color.BLACK );
 
		update( radius, blur_size );
	} 
 
	/** 
	 * Sets the stroke width. 
	 *  
	 * @param value 
	 *           the new stroke width 
	 */ 
	public void setStrokeWidth( float value ) {
		mStrokeWidth = value;
		mPaint.setStrokeWidth( mStrokeWidth );
		invalidateSelf(); 
	} 
 
	/** 
	 * Update. 
	 *  
	 * @param radius 
	 *           the radius 
	 * @param blur_size 
	 *           the blur_size 
	 */ 
	public void update( float radius, int blur_size ) {
		mOriginalRadius = radius;
		if ( blur_size > 0 )
			mPaint.setMaskFilter( new BlurMaskFilter( blur_size, Blur.NORMAL ) );
		else 
			mPaint.setMaskFilter( null );
		invalidateSelf(); 
	} 
 
	/* 
	 * (non-Javadoc)