I need to use few buttons in my project with different design. So I'm using drawable shape to make custom button.
Let's say I need a button with rounded corner and green background. So I've created a shape "gree_round_button.xml" and this works fine. But then again I need another button with same style just background color would be different, for that do I must need to create another xml file like "colorName_round_button.xml"?
I'm keeping it simple for understanding purpose but there could be many common style for different button may be just one or two property different. Is there any way that I can skip creating multiple files for same design? Is there any way that I can use to extend any shape and may be pass color,background color as a parameter? May be like this "button.xml" this shape will accept one parameter for color and I can use this shape for every button I want to use and just pass the different color as a parameter.
In Web Css: I can do something like this
.button {border: 1px solid #ddd;border-radius:5px;padding:20px;}
.button.green {background:green;}
Is there any easy way to do something like this. Thanks.