Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bitvale/Switcher
Android implementation of switch animation from Oleg Frolov
https://github.com/bitvale/Switcher
Last synced: 13 days ago
JSON representation
Android implementation of switch animation from Oleg Frolov
- Host: GitHub
- URL: https://github.com/bitvale/Switcher
- Owner: bitvale
- Created: 2018-11-15T21:23:42.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-01-03T17:24:10.000Z (almost 3 years ago)
- Last Synced: 2024-10-15T09:41:04.765Z (25 days ago)
- Language: Kotlin
- Homepage: https://android.jlelse.eu/android-dynamic-custom-view-is-easy-433258cbb80f
- Size: 1.24 MB
- Stars: 1,334
- Watchers: 18
- Forks: 92
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-kotlin - Switcher - Android implementation of switch animation from Oleg Frolov (Libraries)
README
# Switcher
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Platform](https://img.shields.io/badge/platform-android-green.svg)](http://developer.android.com/index.html)
[![API](https://img.shields.io/badge/API-17%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=17)
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Switcher-orange.svg?style=flat)](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 4dpKotlin
-----```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).