Android implementation of switch animation from Oleg Frolov
Clone or download
Latest commit e1602a0 Dec 3, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
art Update readme Dec 3, 2018
demo Update Readme Nov 18, 2018
gradle/wrapper Initial commit Nov 18, 2018
library Update Readme Nov 18, 2018
.gitignore Initial commit Nov 18, 2018
README.md Update readme Dec 3, 2018
build.gradle Initial commit Nov 18, 2018
gradle.properties Initial commit Nov 18, 2018
gradlew Initial commit Nov 18, 2018
gradlew.bat Initial commit Nov 18, 2018
settings.gradle Initial commit Nov 18, 2018

README.md

Switcher

sample

License Platform API

Created this cool switch animation from Oleg Frolov as an android library.

Read on Medium

USAGE

Just add Switcher view in your layout XML and Switcher library in your project via Gradle:

dependencies {
  implementation 'com.bitvale:switcher:1.0.0'
}

XML

<com.bitvale.pacbutton.SwitcherX // or SwitcherC
    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" />

You must use the following properties in your XML to change your Switcher.

Properties:
  • android:checked (boolean) -> default true
  • app:switcher_on_color (color) -> default #48ea8b
  • app:switcher_off_color (color) -> default #ff4651
  • app:switcher_icon_color (color) -> default white

Kotlin

switcher.setOnCheckedChangeListener { checked ->
    if (checked) action()
}

LICENCE

Switcher by Alexander Kolpakov is licensed under an Apache License 2.0.