Skip to content

Instantly share code, notes, and snippets.

@molidev8
Created November 17, 2022 19:02
Show Gist options
  • Save molidev8/e8cca70ba78f658f66acc46613500bf8 to your computer and use it in GitHub Desktop.
Save molidev8/e8cca70ba78f658f66acc46613500bf8 to your computer and use it in GitHub Desktop.
A custom thumb for a Switch view
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true">
<shape android:shape="rectangle">
<corners android:radius="20dp" />
<solid android:color="@color/blue_800" />
<size android:width="24dp" android:height="24dp" />
<stroke android:width="4dp" android:color="@android:color/transparent" />
</shape>
</item>
<item android:state_checked="false">
<shape android:shape="rectangle">
<corners android:radius="20dp" />
<solid android:color="@color/gray_dark" />
<size android:width="24dp" android:height="24dp" />
<stroke android:width="4dp" android:color="@android:color/transparent" />
</shape>
</item>
</selector>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment