ToggleButton
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'