package com.chaoran.component;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.view.View;

public class SelfHRule extends View {
	private Paint mPaint;  
	private int color;
	public SelfHRule(Context context) {
		super(context);
		init();
	}
	public SelfHRule(Context context, AttributeSet attrs) {
		super(context, attrs);
		init();
	}
	private void init(){
		color=Color.GRAY;
		mPaint = new Paint();        
		mPaint.setStyle(Paint.Style.FILL_AND_STROKE);  
//		mPaint.setColor(Color.RED);
	}
    @Override
    protected void onDraw(Canvas canvas) {
    	super.onDraw(canvas);
    	mPaint.setColor(color);  
    	Rect r=new Rect(0,0, this.getWidth(),this.getHeight());
    	canvas.drawRect(r, mPaint);
    }
	public int getColor() {
		return color;
	}
	public void setColor(int color) {
		this.color = color;
	}
}
