When to use CheckBox and when Switch
Asked Answered
O

4

47

Can anyone can tell me when to use Checkbox and when Switch?

I mean, what is the real login difference between the two in the context of a PreferenceActivity?

For example, will you change the next section to Checkboxes? It's part of a set, but using a Switch here looks better.

enter image description here

Obtrude answered 20/1, 2014 at 10:20 Comment(1)
I'd say use checkboxes for selecting multiple linked items in a list of related preferences, and switch when the item is independent from others. But that's just me. I guess in the end it comes down to what makes sense to you (and your users, of course). Good question, +1.Emerald
U
49

I actually find this to be quite an interesting question, particularly considering that one can easily emulate the functionality of a switch using a checkbox in Android.

According to the Android developers guide, a checkbox is simply a type of switch. Check the quotes below or read the full description here.

Checkboxes: Checkboxes allow the user to select multiple options from a set. Avoid using a single checkbox to turn an option off or on. Instead, use an on/off switch.

On/off Switches: On/off switches toggle the state of a single settings option.

Ulcer answered 20/1, 2014 at 10:26 Comment(2)
It's important to note that for a set of checkboxes, an additional "submit" or "save" button is required to mark the completion. Switches however are instantaneous, with immediate effect.Minute
@AjitZero: The style guide doesn't say that, and it's not consistent with actual practice either.Drogin
C
7

Disclaimer I'm not UX expert.

Besides what @KentHawkings has already cited from Google's design guidelines (checkboxes for list of non-exclusive options and switch for a single option), there is a good (IMHO) use case for checkbox for a single option - when the checkbox clearly means yes/no.

Good idea for checkbox: "Show notifications" option.

Bad idea for checkbox: "Wi-Fi" option (as in Android Settings).
You could use checkbox here if this option was titled "Wi-Fi is enabled", but quite obviously "Wi-Fi" with "On/Off" switch is more concise.

Note that Play Market doesn't follow Google's own guidline - it uses checkboxes in its Settings all over the place.

Cb answered 10/8, 2015 at 13:12 Comment(3)
Google Play has a really good reason to do so, It needs to be compatible and consistent throughout all Android devices back to ancient API levels (like Android 2.3). Switches and switch preferences were added in API level 14] and switch preferences are not included in the support library that works on API level 9. I've found a third-party library for that, haven't tried it though.Abysmal
@cuddlecheek I think, there are a couple of able programmers at Google, who could weither 1. add switches to support lib v7 or 2. implemet switches as custom widgets inside Play app :-PCb
Of course they could do that, but I suppose Google Play app and Support library are developed by different teams. So I assume Google play team didn't bother to organize adding switches to support library v7 and probably didn't find it so important to implement it themselves. I would say that if they started to developing the app for API 14+, they would use switch in appropriate places.Abysmal
F
4

After following the Settings option in android device, my opinion for difference between checkbox and switch is that:

  1. CheckBox are usually used to mark/unmark the particular setting in the service.
  2. Switches are used to turnOn/turnOff the particular services.

Possibly, that is why checkbox are treated as subset/type of switch as they allow to mark/unmark an option within the service itself( not the entire service).

Fanfare answered 20/1, 2014 at 10:39 Comment(0)
I
0

CheckBox means it is a toggle and only a toggle. Switches means it is a toggle and if you click the text area (title and summary) some more settings window should pop up.

Inaccurate answered 29/11, 2017 at 17:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.