Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/luongvo/ios-switchview
A lightweight iOS switch view style for Android
https://github.com/luongvo/ios-switchview
android android-widget ios library switch-control
Last synced: 2 months ago
JSON representation
A lightweight iOS switch view style for Android
- Host: GitHub
- URL: https://github.com/luongvo/ios-switchview
- Owner: luongvo
- License: apache-2.0
- Created: 2017-03-13T03:47:16.000Z (almost 8 years ago)
- Default Branch: develop
- Last Pushed: 2023-02-08T05:26:12.000Z (almost 2 years ago)
- Last Synced: 2024-07-07T09:26:27.578Z (7 months ago)
- Topics: android, android-widget, ios, library, switch-control
- Language: Java
- Homepage:
- Size: 248 KB
- Stars: 80
- Watchers: 3
- Forks: 26
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# iOS-SwitchView
[![](https://jitpack.io/v/luongvo/iOS-SwitchView.svg)](https://jitpack.io/#luongvo/iOS-SwitchView)A lightweight iOS switch view style for Android
# Usage
Add SwitchView into xml layout
```xml```
or custom properties:
```xml```
Add listener in activty
```java
switchView.setOnCheckedChangeListener(new SwitchView.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(SwitchView switchView, boolean isChecked) {
Toast.makeText(MainActivity.this, "onCheckedChanged: " + isChecked, Toast.LENGTH_SHORT).show();
}
});
```# Installation
**Step 1.** Add the JitPack repository to your build file
```groovy
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
```
**Step 2.** Add the dependency
```groovy
dependencies {
compile 'com.github.luongvo:iOS-SwitchView:[LATEST_VERSION]'
}
```