# Switcher **Repository Path**: ouyangpengdev/Switcher ## Basic Information - **Project Name**: Switcher - **Description**: Android implementation of switch animation from Oleg Frolov - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-03-23 - **Last Updated**: 2024-11-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## 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 USAGE ----- Just add Switcher view in your layout XML and Switcher library in your project via Gradle: ```gradle dependencies { implementation 'com.bitvale:switcher:1.1.0' } ``` 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).