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 prefe开发者_开发百科rence. 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?
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:
see if this helps you out:
http://code.google.com/p/android-color-picker/
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.
精彩评论