Declarative dependencies for proxy settings too
This commit is contained in:
parent
b4d8ee08dc
commit
77419183ec
@ -65,11 +65,13 @@
|
||||
<EditTextPreference
|
||||
android:key="proxyHost"
|
||||
android:title="@string/proxy_host"
|
||||
android:summary="@string/proxy_host_summary" />
|
||||
android:summary="@string/proxy_host_summary"
|
||||
android:dependency="enableProxy" />
|
||||
<EditTextPreference
|
||||
android:key="proxyPort"
|
||||
android:title="@string/proxy_port"
|
||||
android:summary="@string/proxy_port_summary" />
|
||||
android:summary="@string/proxy_port_summary"
|
||||
android:dependency="enableProxy" />
|
||||
</PreferenceCategory>
|
||||
<PreferenceCategory android:title="@string/other">
|
||||
<CheckBoxPreference android:title="@string/cache_downloaded"
|
||||
|
@ -152,15 +152,6 @@ public class PreferenceFragment
|
||||
} else if (key.equals(Preferences.PREF_ENABLE_PROXY)) {
|
||||
CheckBoxPreference pref = (CheckBoxPreference) findPreference(key);
|
||||
pref.setSummary(R.string.enable_proxy_summary);
|
||||
Preference h = findPreference(Preferences.PREF_PROXY_HOST);
|
||||
Preference p = findPreference(Preferences.PREF_PROXY_PORT);
|
||||
if (pref.isChecked()) {
|
||||
h.setEnabled(true);
|
||||
p.setEnabled(true);
|
||||
} else {
|
||||
h.setEnabled(false);
|
||||
p.setEnabled(false);
|
||||
}
|
||||
|
||||
} else if (key.equals(Preferences.PREF_PROXY_HOST)) {
|
||||
EditTextPreference textPref = (EditTextPreference) findPreference(key);
|
||||
|
Loading…
x
Reference in New Issue
Block a user