jaibatrik jaibatrik - 1 year ago 123
Android Question

Android Toggle Button - Material Design

How do I implement the Toggle Buttons as specified in Material Design guidelines here?

Is it available out of the box from Android Design Support Library or is there any third party library available?

Answer Source

Current Library Support: No.

As of the Support Library v23.2 the current ToggleButton implementation does not behave nor is it styled as outlined in the referenced Material Design Guidelines.

Material guidelines:

sample Material toggle button

Current support library styling:

current support library ToggleButton

Note that the buttons don't meet up together in groups surrounded by rounded borders, text is used instead of icons, and the accent color is used as an underline instead of a darkened background to indicate an 'on' status.

Is there an external library: Not yet.

I'm not aware of any defacto standard library to implement a Material ToggleButton, but there are probably a few small, barely tested ones out there, I hope? Unfortunately, Stackoverflow discourages Answers that are just links to external third-party libraries. So you'll need to search on your own, or create a custom view yourself to implement the current Material design guidelines.