package com.wasu.cs.widget;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.DashPathEffect;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PathEffect;
import android.util.AttributeSet;
import android.view.View;

public class DashedLineView extends View {
	
	public DashedLineView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

	@Override
	protected void dispatchDraw(Canvas canvas) {
		// TODO Auto-generated method stub
		super.dispatchDraw(canvas);
        Paint paint = new Paint();
        paint.setStyle(Paint.Style.STROKE);
        paint.setColor(0xFF344438);
        Path path = new Path();
        path.moveTo(0, this.getHeight() / 2);
        path.lineTo(this.getWidth(), this.getHeight() / 2);
        PathEffect effects = new DashPathEffect(new float[]{10,5,10,5},1);
        paint.setPathEffect(effects);
        canvas.drawPath(path, paint);
	}
	
    @Override
    protected void onDraw(Canvas canvas) {
        // TODO Auto-generated method stub
        super.onDraw(canvas);
    }
}
