ab11
ab11

Reputation: 20100

Android: Color preference?

I would like to add an option to my application preferences that allows users to select a color, but am not sure of a good strategy. I have a color picker which I can show in a dialog, so I could use a dialog preference. But I see no good way of indicating in the dialog preference what the current color is (I would like to be able to add a "swatch" of color to the preference layout, to indicate the current color; or something similar). Any suggestions for how to make a user friendly color preference?

Upvotes: 4

Views: 5093

Answers (3)

IvanRF
IvanRF

Reputation: 7265

I tried this one: mColorPicker

It is very easy to use. You can download the code and see an example.

This is how it looks:

enter image description here

Upvotes: 2

dwemthy
dwemthy

Reputation: 471

I need the same preference interface, and it looks like displaying the color swatch should be possible by overriding getLayoutResource() in the base Preference class and implementing an xml layout to include the swatch.

Upvotes: 0

Starwfanatic
Starwfanatic

Reputation: 614

see if this helps you out:

http://code.google.com/p/android-color-picker/

Upvotes: 0

Related Questions