Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

iOS风格SwitchButton。 只涉及到一个类文件,异常容易集成进入你的项目。支持开关的"延时和回滚"操作。only one class file, very easy to integrate into your program. support the delay operation and rolling back action of the switch

Notifications You must be signed in to change notification settings

wkangle/SwitchButton

Repository files navigation

SwitchView

Download

DemoApp.apk

Usage

  1. Include the library as local library project.

compile 'ch.ielse:switchbutton:1.0.0'

  1. in your layout.xml
<ch.ielse.view.SwitchView
 android:layout_width="wrap_content"
 android:layout_height="wrap_content"/>

3.in your activity

switchView.setOnClickListener(new View.OnClickListener() {
 @Override
 public void onClick(View v) {
 boolean isOpened = switchView.isOpened();
 }
 });

or

switchView.setOnStateChangedListener(new SwitchView.OnStateChangedListener() {
 @Override
 public void toggleToOn(SwitchView view) {
 view.toggleSwitch(true); // or false
 }
 @Override
 public void toggleToOff(SwitchView view) {
 view.toggleSwitch(false); // or true
 }
 });

Appreciation

Contact

QQ Group : 274306954

##Others hope you like my work. Star support me a lot. thanks

About

iOS风格SwitchButton。 只涉及到一个类文件,异常容易集成进入你的项目。支持开关的"延时和回滚"操作。only one class file, very easy to integrate into your program. support the delay operation and rolling back action of the switch

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%

AltStyle によって変換されたページ (->オリジナル) /