eltos / SimpleDialogFragments

An Android library to create dialogs with ease and handle user interaction reliably, using fragments and material design.
Apache License 2.0
119 stars 17 forks source link

ColorPicker FormElement should allow to unset color, if not set as required #92

Closed mtotschnig closed 5 months ago

mtotschnig commented 5 months ago

My use case is a SimpleFormDialog where user can configure a tag by defining label and color. When editing an existing tag, it should also be possible to remove the color, because user might have realized that they prefer the behavior of colorless tags.

Design My suggestion would be that on the Color selection grid, clicking on the selected color would deselect the color, and setting value to Color.NONE

mtotschnig commented 5 months ago

@eltos If you are interested in the idea, and the suggested implementation, I can open a PR,

eltos commented 5 months ago

In principle yes, for the multi select color picker deselect already works. However in the single select case I am thinking it will not be very intuitive. A negative button labelled "None" or "Reset" would be more intuitive for the user, don't you think?

mtotschnig commented 5 months ago

A UI element clearly expressing the purpose of removing the color is probably more intuitive, although I think most users are familiar with deselecting an option by clicking on it. But in the case of the form element, it shouldn't even be necessary to open the color selector just for deselecting. A button with a clear or delete icon should already be present on the form.

eltos commented 5 months ago

A button with a clear or delete icon should already be present on the form.

I also thought about this, and for form element I agree that it's clearly the best solution. Thanks for the PR 👌

It does not address cases when the color picker is used in a different context, but let's focus on your use case first.