Code example for Paint

Methods: getStrokeWidth, setARGB, setAntiAlias, setPathEffect, setStrokeCap, setStrokeWidth, setStyle

0
	private static final Paint pathTurnSegmentPeakOutlinePaint;
	private static final Paint pathTurnSegmentPaint;
	private static final Paint pathTurnSegmentOutlinePaint;
 
	static{ 
		pathTurnSegmentPaint = new Paint();
		pathTurnSegmentPaint.setARGB(255, 255, 255, 255); // white
		pathTurnSegmentPaint.setStrokeWidth(8);
		pathTurnSegmentPaint.setStyle(Paint.Style.STROKE);
		pathTurnSegmentPaint.setStrokeCap(Cap.ROUND);
 
		pathTurnSegmentOutlinePaint = new Paint(pathTurnSegmentPaint);
		pathTurnSegmentOutlinePaint.setARGB(255, 0, 0, 0); // black
		pathTurnSegmentOutlinePaint.setStrokeWidth(pathTurnSegmentPaint.getStrokeWidth()+2);
 
		pathTurnSegmentPeakPaint = new Paint(pathTurnSegmentPaint);
		pathTurnSegmentPeakPaint.setStyle(Paint.Style.FILL_AND_STROKE);
		pathTurnSegmentPeakPaint.setStrokeWidth(1);
 
		pathTurnSegmentPeakOutlinePaint = new Paint(pathTurnSegmentOutlinePaint);
		pathTurnSegmentPeakOutlinePaint.setStyle(Paint.Style.STROKE);
		pathTurnSegmentPeakOutlinePaint.setStrokeWidth(pathTurnSegmentPeakPaint.getStrokeWidth()+2);
 
 
		pathTurnSegmentPaint.setAntiAlias(true);
		pathTurnSegmentOutlinePaint.setAntiAlias(true);
		pathTurnSegmentPeakPaint.setAntiAlias(true);
		pathTurnSegmentPeakOutlinePaint.setAntiAlias(true);
 
		pathTurnSegmentPaint.setPathEffect(new CornerPathEffect(pathTurnSegmentPaint.getStrokeWidth() / 2));
		pathTurnSegmentOutlinePaint.setPathEffect(new CornerPathEffect(pathTurnSegmentOutlinePaint.getStrokeWidth() / 2));
		pathTurnSegmentPeakPaint.setPathEffect(new CornerPathEffect(pathTurnSegmentPeakPaint.getStrokeWidth() / 2));
		pathTurnSegmentPeakOutlinePaint.setPathEffect(new CornerPathEffect(pathTurnSegmentPeakOutlinePaint.getStrokeWidth() / 2));
	}