5 Android Libraries to Inspire the Designer in You – Better Programming

To end things, we have an uber-cool switch design implementation useful for any toggle options in your applications.

Once you’ve added the Gradle dependency, all you need to do is add the following view in your XML, set the color for the various states and optionally handle the change in states in your Kotlin code.

<com.bitvale.switcher.SwitcherX
android:id="@+id/switcher"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:switcher_on_color="@color/on_color"
app:switcher_off_color="@color/off_color"
app:switcher_icon_color="@color/icon_color" />

Source link

Leave a Reply

Your email address will not be published. Required fields are marked *