2

I want to add themes in my app. For this I want to add a color selector dialog, which will select the color and apply the particular theme.

How to add color schemes to this?

Dialog like below image, colors in circle and arrow above which shows which color is selected.

enter image description here

How can I do this? Thank you..

Sid
  • 2,792
  • 9
  • 55
  • 111

1 Answers1

0

To summary:

  1. Must have a list of color (c1, c2, ...) in value resource.
  2. Must have a list of theme of corresponding color (th1, th2, ...) in style resource.
  3. Create a color picker layout (color_picker_dialog.xml) for dialog: table layout or something that can display those colors
  4. Create custom dialog and set the content view of the dialog as color_picker_dialog.xml
  5. Add SetOnclickListener to each element in the dialog to response to user click.
T D Nguyen
  • 7,054
  • 4
  • 51
  • 71