Code example for CornerPathEffect

0
	 
	private void drawPrimary(Canvas canvas, Paint p) {
		p.setShader(new LinearGradient(getWidth()/2, 0.0f, getWidth()/2, getHeight(),
			mColorPrimary, mColorPrimaryShadow, Shader.TileMode.CLAMP)
		); 
		p.setPathEffect(new CornerPathEffect(mCornerRadius));
		 
		canvas.drawRect(0, 0, scalePrimary(getWidth()), getHeight(), p);
	} 
	 
	private void drawSecondary(Canvas canvas, Paint p) {
		p.setShader(new LinearGradient(getWidth()/2, 0.0f, getWidth()/2, getHeight(),
			mColorSecondary, mColorSecondaryShadow, Shader.TileMode.CLAMP)
		); 
		p.setPathEffect(null);
		 
		canvas.drawRect(0, getHeight()-DEFAULT_SECONDARY_HEIGHT, scaleSecondary(getWidth()), getHeight(), p);
	} 
	 
	private void drawTicks(Canvas canvas, Paint p) {
Contextual code suggestions in your IDE  Get Codota for Java