Code example for TextPaint

Methods: setColorsetShader

0
	@Override 
	public void onDraw(Canvas canvas){
		super.onDraw(canvas);
		 
		if(isMarginShow){
			paint.setShader(null);
			paint.setColor(colorOffsetDark);
			canvas.translate(-offset, -offset);
			layout.draw(canvas);
			//canvas.drawText(text, 0, centerY + (textBound.height() / 2) - (offset * 2), paint); 
			paint.setColor(colorOffsetBright);
			canvas.translate(offset, offset);
			layout.draw(canvas);
			//canvas.drawText(text, 0, centerY + (textBound.height() / 2), paint); 
			paint.setColor(textColor);
			paint.setShader(shader);
			canvas.translate(-offset, -offset);
			layout.draw(canvas);
			//canvas.drawText(text, 0, centerY + (textBound.height() / 2) - offset, paint); 
		}else{ 
			paint.setColor(textColor);
Connect your IDE to all the code out there  Get Codota for Java