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 defined so that they have a round style. For this, I used an XML file with the shape property.
I wanted each of these buttons to have a different color. However, I do not want to create multiple XML files by setting the color of each. I want to know if you have any different way of changing the color without touching your background, or even changing the color of the shape button.
I also accept suggestions for doing this table in a different way, without needing to use a lot of buttons.
Button background XML file:
<?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>