https://github.com/bitvale/checkboxswitcher
Android implementation of checkbox switch animation from Oleg Frolov
https://github.com/bitvale/checkboxswitcher
Last synced: 19 days ago
JSON representation
Android implementation of checkbox switch animation from Oleg Frolov
- Host: GitHub
- URL: https://github.com/bitvale/checkboxswitcher
- Owner: bitvale
- Created: 2019-07-27T09:08:14.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-07-27T09:11:01.000Z (almost 6 years ago)
- Last Synced: 2025-04-08T21:23:16.974Z (about 2 months ago)
- Language: Kotlin
- Homepage:
- Size: 326 KB
- Stars: 17
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CheckboxSwitcher
[](https://opensource.org/licenses/Apache-2.0)
[](http://developer.android.com/index.html)
[](https://android-arsenal.com/api?level=19)Created this [switch animation](https://dribbble.com/shots/6266357-Checkboxswitcher) from [Oleg Frolov](https://dribbble.com/Volorf) as an android library.
USAGE
-----Just add CheckboxSwitcher view in your layout XML and CheckboxSwitcher library in your project via Gradle:
```gradle
dependencies {
implementation 'com.bitvale:checkboxswitcher:1.0.0'
}
```XML
-----```xml
```
You must use the following properties in your XML to change your Switcher.
##### Properties:
* `android:checked` (boolean) -> default false
* `app:switcher_height` (dimension) -> default 26dp // width is calculated automatically
* `app:switcher_bg_color` (color) -> default white
* `app:thumb_on_color` (color) -> default #95cd75
* `app:thumb_off_color` (color) -> default #e5e5e5
* `app:thumb_icon` (reference) -> default check icon
* `app:elevation` (dimension) -> default 4dpKotlin
-----```kotlin
switcher.setOnCheckedChangeListener { checked ->
if (checked) action()
}
```LICENCE
-----CheckboxSwitcher 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).