Created
February 4, 2020 01:40
-
-
Save jayde-bog/ce9ccd1cb251a60b28a9d0e6b277963e to your computer and use it in GitHub Desktop.
Android SwitchCompat custom style
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<androidx.appcompat.widget.SwitchCompat | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:checked="false" | |
android:thumb="@drawable/more_switch_thumb" | |
app:track="@drawable/more_switch_track" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | |
<item android:left="2dp" android:top="2dp" android:right="2dp" android:bottom="2dp"> | |
<shape | |
android:shape="oval"> | |
<size android:width="22dp" android:height="22dp" /> | |
<solid android:color="#FFFFFF" /> | |
</shape> | |
</item> | |
</layer-list> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | |
<item android:state_checked="true"> | |
<shape> | |
<solid android:color="#FF5A00" /> | |
<corners android:radius="13dp" /> | |
<size android:height="26dp" /> | |
</shape> | |
</item> | |
<item > | |
<shape> | |
<solid android:color="#C6C6C6" /> | |
<corners android:radius="13dp" /> | |
<size android:height="26dp" /> | |
</shape> | |
</item> | |
</selector> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment