Create beautiful toggle buttons in android

We don’t talk about toggle switches as often as we should. Toggle switches are these amazing UI components that provide functionality to switch between states, like pause and play, on and off, active and inactive. Imagine how messy it would have been if we had to do these with some other UI component like buttons or something.