Fix dialog state handling.

Convert ApplicationLightPreference into a DialogPreference to correctly
manage the dialog lifecycle, e.g. when rotating the device. Also save
the user-defined color in case the dialog was open.

Change-Id: Ife00e1c4737fbf6710ccdaa1252def00f2831af3
JIRA:CYAN-914
Colour picker text input field: wrong content due to alpha channel.

The field was, effectively, showing AARRGG instead of RRGGBB due to
the alpha component being non-zero. This change fixes that in a
generic way which allows for alpha channel handling even though I see
no use for the alpha channel for the notification light.

Change-Id: I5b71340f3b644c6f6b305dc66d1285cc77427bf5