I have a state list like this:
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_pressed="true"
android:drawable="@color/dark_green" />
<item android:drawable="@color/bright_green" />
</selector>
And a shape like this (for rounding my button):
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<corners android:bottomRightRadius="7dp" android:bottomLeftRadius="7dp" android:topLeftRadius="7dp" android:topRightRadius="7dp"/>
</shape>
My question is how do I apply both of them? If i set the backgroundResource
to the color list, then I get the color, but then I cant use it for the shape. I tried using backgroundResource
for the shape and backgroundColor
for the color, but that didn't work.