I need to create a custom image view for choosing color by design. When user click the circle, inner white circle with a tick should appear, like in example below:
Otherwise, it should be just a circle shape with some color (unchecked state), like below:
The main problem, that I do not know how to create a selector with the inner circle inside and with keeping the ability to setup color programmatically.
Simple rounded shape I can setup, for example, like this:
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/circle_crop"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_gravity="center"
android:src="@android:color/holo_red_dark" />
How to modify it to setup white circle with tick inside on a checked state (when user click on it)?


So easy.
1. Create
layer-listDrawableCalled "icon_check"2. Create
selectorDrawableCalled "foreground_check"3. Setup
CardView4. Setup Ui Controller
Result: