মঙ্গলবার, ২০ আগস্ট, ২০১৯

Change default SwitchCompat Color (Android)

Add the following custom style in styles.xml

<style name="SwitchCompatCustom">
    <item name="colorControlActivated">@color/desired_color</item>
</style>

And then add the style as theme while declaring the switch in xml like following

<android.support.v7.widget.SwitchCompat
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:theme="@style/SwitchCompatCustom"/>