Show system DNS as hint text

This commit is contained in:
M66B 2016-01-26 20:51:56 +01:00
parent c6658c8531
commit 05025a575d
2 changed files with 3 additions and 4 deletions

View File

@ -199,8 +199,8 @@ public class ActivitySettings extends AppCompatActivity implements SharedPrefere
}); });
} }
Preference pref_dns = screen.findPreference("dns"); EditTextPreference pref_dns = (EditTextPreference) screen.findPreference("dns");
pref_dns.setSummary(Util.getDefaultDNS(this)); pref_dns.getEditText().setHint(Util.getDefaultDNS(this));
// Handle technical info // Handle technical info
Preference.OnPreferenceClickListener listener = new Preference.OnPreferenceClickListener() { Preference.OnPreferenceClickListener listener = new Preference.OnPreferenceClickListener() {
@ -463,8 +463,6 @@ public class ActivitySettings extends AppCompatActivity implements SharedPrefere
SinkholeService.reload(null, "changed " + name, this); SinkholeService.reload(null, "changed " + name, this);
else if ("dns".equals(name)) { else if ("dns".equals(name)) {
if (TextUtils.isEmpty(prefs.getString(name, "")))
prefs.edit().remove(name).apply();
if (prefs.getBoolean("filter", false)) if (prefs.getBoolean("filter", false))
SinkholeService.reload(null, "changed " + name, this); SinkholeService.reload(null, "changed " + name, this);
} }

View File

@ -160,6 +160,7 @@
android:title="Native log level" /> android:title="Native log level" />
<EditTextPreference <EditTextPreference
android:defaultValue="" android:defaultValue=""
android:dependency="filter"
android:inputType="text" android:inputType="text"
android:key="dns" android:key="dns"
android:title="DNS" /> android:title="DNS" />