Difference between defining a value in color and drawable tag?
Question
<resources>
<drawable name="red">#7f00</drawable>
....
<color name="solid_red">#f00</color>
.....
</resources>
This is some part of the colors.xml from android samples directory.
Now my question is that, what is the difference between defining a color in <drawable>
tag and <color>
tag ?
Solution
Basically nothing. They both create a resource that is a "color" value holding a 32 bit color. One is just a drawable subtype, one is a color subtype. When you retrieve a Drawable from resources, if the resource is actually a color constant it knows how to create a Drawable object for that.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow