I'm trying to work out how to implement a preferences XML file that
has two mutually exclusive preference categories, only one of which is
displayed and enabled based on a parent checkbox preference. When
checked, category 'a' should be displayed and 'b' hidden. When
unchecked, category 'a' should be hidden and 'b' displayed.
Now the android:dependency property allows me to identify a
controlling parent preference, but the parent value that disables the
dependency is specified on the parent (the
android:disableDependentsState property). So it appears that I can't
enable one category while disabling another:
<CheckBoxPreference
android:key="use_option_one"
android:title="@string/use_option_one"
android:summary="@string/use_option_one_summary"
android:defaultValue="true" />
<PreferenceCategory android:title="@string/option_one_options"
android:dependency="use_option_one"
android:shouldDisableView="true"> ... </PreferenceCategory>
<PreferenceCategory android:title="@string/option_two_options"
android:dependency="use_option_one"
android:shouldDisableView="true"> ... </PreferenceCategory>
I've tried "!use_option_one" out of curiosity but this is not a
supported syntax.
Can somebody confirm (a) that my understanding is correct and (b)
suggest an alternative implementation pattern to achieve the desired
effect?
Thanks,
Phil.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en