Projects
View on GitHub 

zcweng/ToggleButton
zcweng/ToggleButton has 2,094 GitHub stars and 670 forks. GitHot measured -1 stars in 24 hours. Last checked 2026-11-06 23:48 UTC. Last push 2023-09-15.
ToggleButton Widget For Android Dev
Measured star growth
- in 24h
- -1
- in 7 days
- Update delayed
- in 15 days
- Update delayed
- in 1 month
- Update delayed
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
OriginalToggleButton
ToggleButton Widget For Android Developers
@Deprecated
!!!项目已经停止维护,新项目移至https://github.com/zcweng/SwitchButton !!!

How To Use
xmlns:toggle="http://schemas.android.com/apk/res-auto"
<com.zcw.togglebutton.ToggleButton
android:layout_width="54dp"
toggle:tbOnColor="#f00"
toggle:tbOffColor="#ddd"
toggle:tbSpotColor="#00f"
toggle:tbOffBorderColor="#000"
toggle:tbBorderWidth="2dp"
android:layout_height="30dp" >
</com.zcw.togglebutton.ToggleButton>
ToggleButton toggleBtn;
//切换开关
toggleBtn.toggle();
//切换无动画
toggleBtn.toggle(false);
//开关切换事件
toggleBtn.setOnToggleChanged(new OnToggleChanged(){
@Override
public void onToggle(boolean on) {
}
});
toggleBtn.setToggleOn();
toggleBtn.setToggleOff();
//无动画切换
toggleBtn.setToggleOn(false);
toggleBtn.setToggleOff(false);
//禁用动画
toggleBtn.setAnimate(false);
Default Size:width=50dp,height=30dp.

引用方式
2016/8/3 17:04:53
compile 'com.zcw:togglebutton-library:1.0.0'
Explore related projects
codecrafters-io/build-your-own-x
Master programming by recreating your favorite technologies from scratch.
560,676 starspublic-apis/public-apis
A collective list of free APIs
496,925 starsmorluto/rea
Reverse engineer anything with agents, from app behavior down to native binaries.
440,064 starsopenclaw/openclaw
The AI that really does things. Any OS. Any Platform. The lobster way. 🦞
394,108 stars