zcweng / SwitchButton

SwitchButton.An beautiful+lightweight+custom-style-easy switch widget for Android,minSdkVersion >= 11
https://github.com/zcweng/SwitchButton
MIT License
2.69k stars 415 forks source link

Changing Button color at runtime from code. #42

Open vivekios opened 5 years ago

vivekios commented 5 years ago

How can i change the color from code. For example: i have online / offline state. For online: it becomes green. For offline: gray color Now suppose at some point of time i want to show busy instead of online. For busy i want to change the on color state to red. How to make this at runtime from code ?

belljay commented 4 years ago

@vivekios I needed to use it for my code so I forked it and fixed forward. Feel free to use https://github.com/belljay/SwitchButton

buelersandra commented 4 years ago

@belljay seen the forked project. can't find the method called to change the button color.

belljay commented 4 years ago

@buelersandra I somehow messed up my branch. Added. setCheckedButtonColor and setUncheckedButtonColor