Code example for DashPathEffect

0
        paint.setStrokeWidth(2);
        // now set for average line 
        paint_average.setColor(Color.RED);
        paint_average.setStyle(Style.STROKE);
        paint_average.setStrokeWidth(2);
        paint_average.setPathEffect(new DashPathEffect(new float[] {10,20}, 0));
        // now set for grid 
        paint_grid.setColor(Color.WHITE);
        paint_grid.setStyle(Style.STROKE);
        paint_grid.setStrokeWidth(1);
        paint_grid.setPathEffect(new DashPathEffect(new float[] {5,10}, 0));
    } 
 
    /** 
     * Constructor, setting the various color and stroke characteristics for the timeline 
     * @param context Reference to the calling {@link android.content.Context} 
     * @param attrs Reference to the {@link android.util.AttributeSet} of the layout drawn for 
     */ 
    public TimelineView(Context context,  AttributeSet attrs) 
    { 
        super(context, attrs);