Below is my code:
<?xml version="1.0" encoding="utf-8"?>
<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:checkMark="@drawable/checking_icon"
android:orientation="vertical"
android:padding="8dp"
android:textSize="18sp" />
For @drawable/checking_icon
in the above xml:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/enable_32" android:state_checked="true"/>
<item android:drawable="@drawable/disable_32"/>
</selector>
How to create the above 2 xmls progrmatically ?
You can simply create your CheckedTextView from XML file by inflating it like
and that should be it. If you want to set the drawable do something like this