# Switcher
[](https://opensource.org/licenses/Apache-2.0)
[](http://developer.android.com/index.html)
[](https://android-arsenal.com/api?level=17)
[](https://android-arsenal.com/details/1/7460)
Created this cool [switch animation](https://dribbble.com/shots/5429846-Switcher-XLIV) from [Oleg Frolov](https://dribbble.com/Volorf) as an android library.
APK
-----
Install the latest [release](https://github.com/bitvale/Switcher/releases/latest)
USAGE
-----
Just add Switcher view in your layout XML and Switcher library in your project via Gradle:
```gradle
dependencies {
implementation 'io.github.bitvale:switcher:1.1.2'
}
```
XML
-----
```xml
```
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
* `app:elevation` (dimension) -> default 4dp
Kotlin
-----
```kotlin
switcher.setOnCheckedChangeListener { checked ->
if (checked) action()
}
```
LICENCE
-----
Switcher by [Alexander Kolpakov](https://play.google.com/store/apps/dev?id=7044571013168957413) is licensed under an [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0).