Code example for ColorDrawable

-1
	private static final int NOT_SET = -1;
	private int alpha = NOT_SET;
 
	public TiBackgroundDrawable() 
	{ 
		background = new ColorDrawable(Color.TRANSPARENT);
		innerRect = new RectF();
	} 
 
	@Override 
	public void draw(Canvas canvas)
	{ 
		if (background != null) {
			background.setBounds((int) innerRect.left, (int) innerRect.top, (int) innerRect.right, (int) innerRect.bottom);
		} 
 
		canvas.save();
 
		if (background != null) {
			if (alpha > NOT_SET) {
Experience pair programming with AI  Get Codota for Java