I have a custom switch. I want the text (on/off) to be in the track and not in the thumb.
I was thinking of setting a selector with text in drawable and setting it as track of the switch. But I cannot set text in a shape. Any ideas how I can do this?
I also want to add some padding to the track, I dont want the thumb to touch the track. This is kind of how I want it to look:
This is the shape of my track:
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"
android:visible="true"
android:useLevel="false">
<corners
android:radius="20dp" />
<size
android:width="48dp"
android:height="21dp" />
<stroke
android:color="#bfbfbf"
android:width="6dp"/>