Skip to content

EmilioHoffmann/CustomSwitch

Repository files navigation

CustomSwitch

Just a simple custom switch, feel free to use/copy.

CustomSwitchDemo.mp4

How to use it

<com.hoffmann.emilio.custom_switch.CustomSwitch
    android:id="@+id/mainSwitch"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:firstOption="@string/first_option"
    app:secondOption="@string/second_option" />

Your activity/fragment

binding.mainSwitch.setSwitchChangedListener {
    if (it == CustomSwitch.SwitchSelected.FIRST) {
        ...
    } else {
        ...
    }
}

About

A custom switch

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages