Code example for GradientDrawable

Methods: setDither

0
 
		colors = new int[2];
		colors[0] = darkerColor;
		colors[1] = color;
 
		GradientDrawable d = new GradientDrawable(GradientDrawable.Orientation.BOTTOM_TOP, colors);
		d.setDither(true);
 
		return d;
	} 
 
	public static synchronized GradientDrawable getRoundedGradiant(int color) {
		GradientDrawable d = getGradiant(color);
		d.setCornerRadius(5);
		return d;
	} 
 
	public static synchronized GradientDrawable getHorizontalGradiant(int color, int backgroundColor) {
		int[] colors = new int[2];
		colors[0] = backgroundColor;
Connect your IDE to all the code out there  Get Codota for Java