2
Hello, in my application there is a table (Alert Dialog) that will be used to select the color of a component. In this table there are several equal buttons with the background already set so that they stay with a round style. For this I used an XML file with the property Shape.
I wanted each of these buttons to have a different color. However, I don’t want to create multiple XML files defining each one’s color. I want to know if you have any different way to change the color without touching your background, or even changing the color of Shape button.
I also accept suggestions to make this table in a different way, without using a lot of buttons.
XML file for button background:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid
android:color="@color/colorPrimary"
/>
<stroke
android:width="2dp"
android:color="@color/colorPrimary" />
</shape>
The second option worked perfectly for me, thank you very much!
– Roque Matheus