I need to create a custom switch
using drawable elements (custom thumb and custom track). I tried several sizes (50x50, 70x70, 100x100) and they all appear out of proportion, unless I use 25x25 icons which look pixelated. How do I scale-down these elements to an appropriate size without lowering its quality?
For example, this is the way it looks now:
This is my switch
<Switch
android:layout_width="220dp"
android:layout_height="10dip"
android:id="@+id/switcSound"
android:layout_marginTop="55dp"
android:track="@drawable/switch_track"
android:thumb="@drawable/switch"
android:textOff=""
android:textOn=""
android:textColor="#FFF"
android:switchMinWidth="55dp"
/>
This is my switch
thumb
xml file:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/toggle_on" android:state_checked="true"/>
<item android:drawable="@drawable/toggle_off" android:state_checked="false"/>
</selector>