Reputation: 311
I am trying to change the color and shape of the checkbox with the below code. The below code changes color of checkbox but does not change the shape of the button. What changes need to be done?
<?xml version="1.0" encoding="UTF-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/disableColor" android:state_enabled="false">
<shape>
<stroke android:width="3dp" android:color="#ffffff" />
<padding android:bottom="1dp" android:left="1dp" android:right="1dp" android:top="1dp" />
<corners android:bottomLeftRadius="7dp" android:bottomRightRadius="7dp" android:topLeftRadius="7dp" android:topRightRadius="7dp" />
</shape>
</item>
<item android:drawable="@color/Yellow" android:state_checked="true">
<shape>
<stroke android:width="3dp" android:color="#ffffff" />
<padding android:bottom="1dp" android:left="1dp" android:right="1dp" android:top="1dp" />
<corners android:bottomLeftRadius="7dp" android:bottomRightRadius="7dp" android:topLeftRadius="7dp" android:topRightRadius="7dp" />
</shape>
</item>
<item android:drawable="@color/Dark_Blue" android:state_checked="false">
<shape>
<stroke android:width="3dp" android:color="#ffffff" />
<padding android:bottom="1dp" android:left="1dp" android:right="1dp" android:top="1dp" />
<corners android:bottomLeftRadius="7dp" android:bottomRightRadius="7dp" android:topLeftRadius="7dp" android:topRightRadius="7dp" />
</shape>
</item>
Checkbox.xml code
<CheckBox
android:id="@+id/dayButton"
style="@style/checkBoxButtonStyle"
android:layout_width="90dp"
android:paddingLeft="2dp"
android:button="@null"
android:layout_marginRight="10dp"
android:layout_height="match_parent"
android:background="@drawable/rounded_edges"/>
Upvotes: 0
Views: 50