How to create this shape programmatically?
If you want to Create
Rounded drawable with Gradient
then use below code.
public static GradientDrawable generateGradientBackgroundCircular(String topColor, String bottomColor) {
int[] colors = {Color.parseColor(topColor), Color.parseColor(bottomColor)};
//create a new gradient color
GradientDrawable gd = new GradientDrawable(GradientDrawable.Orientation.TL_BR, colors);
gd.setShape(GradientDrawable.OVAL);
return gd;
}