Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

Awesome Lists containing this project

README

        

# Switcher

sample

[![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.


Read on Medium

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).