mercredi 5 juillet 2017

Preference with an enable checkbox next to it

I have a number of preferences and I want to be able to enable/disable them one by one. Because it is a rather long list, I want to put the checkbox to enable/disable the preference next to the preference itself (see sketch below). Hence, two preferences with android:dependency would functionally be OK, but I want to change the layout.

How do I best do this? Should I create a new Preference which internally holds both the checkbox and the underlying preference, or is it easier to change the layout of the PreferenceScreen? If the latter, how would I do that? Should I extend PreferenceScreen or PreferenceCategory?

enter image description here




Aucun commentaire:

Enregistrer un commentaire