According to what I’ve read, you can use a gradientDrawable and have three colors set for it, for example:
<gradient startColor="#00FF00" centerColor="#FFFF00" endColor="#FFFFFF"/>
But what if I want more than three colors, and not only that, I want to be able to set where to put each (in weight/percentage)?
Is it possible using the API or should I make my own customized drawable? If I need to make my own customized drawable, how should I do it?
put this code in your onCreate() method:
and use this drawable as a background.
You can add more than three colors in xml also by creating layers. But in XML it is quite complicated.