Android Thumb and Track Switch

guys! I have a question :), trying to configure the switch a bit, for example, the switch circuit will have a border, and the inside is the one you click to activate the event, also with a frame, but in a way that it will not overlap the switch boundary . Since I do not have enough reputation, I canโ€™t post the photo, so I hope this is clear enough :) that I have received so far:

<?xml version="1.0" encoding="utf-8"?>

<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
    <size android:height="50dp"/>
    <corners
        android:radius="3dp"/>

    <stroke
        android:width="2dp"
        android:color="@color/wampRed"/>

</shape>


<?xml version="1.0" encoding="utf-8"?>

<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="@color/wampRed"/>
    <corners
        android:radius="2dp"/>


</shape>

<

Switch
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/switchButton"
        android:layout_marginBottom="40dp"
        android:textOn=""
        android:thumb="@drawable/shape_track"
        android:track="@drawable/shape_thumb"
        android:layout_marginRight="5dp"
        android:textOff="       "
        android:layout_alignParentBottom="true"
        android:layout_toRightOf="@+id/dateOutput"

        />
+4
source share

All Articles