mirror of
https://github.com/M66B/NetGuard.git
synced 2025-01-02 13:24:09 +00:00
Fix, refactoring
This commit is contained in:
parent
533c1428ef
commit
e1bb6536df
2 changed files with 9 additions and 9 deletions
|
@ -102,14 +102,6 @@ public class ActivitySettings extends AppCompatActivity implements SharedPrefere
|
||||||
PreferenceScreen screen = getPreferenceScreen();
|
PreferenceScreen screen = getPreferenceScreen();
|
||||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
|
||||||
// Stats
|
|
||||||
EditTextPreference pref_stats_base = (EditTextPreference) screen.findPreference("stats_base");
|
|
||||||
EditTextPreference pref_stats_frequency = (EditTextPreference) screen.findPreference("stats_frequency");
|
|
||||||
EditTextPreference pref_stats_samples = (EditTextPreference) screen.findPreference("stats_samples");
|
|
||||||
pref_stats_base.setTitle(getString(R.string.setting_stats_base, prefs.getString("stats_base", "5")));
|
|
||||||
pref_stats_frequency.setTitle(getString(R.string.setting_stats_frequency, prefs.getString("stats_frequency", "1000")));
|
|
||||||
pref_stats_samples.setTitle(getString(R.string.setting_stats_samples, prefs.getString("stats_samples", "90")));
|
|
||||||
|
|
||||||
// Wi-Fi home
|
// Wi-Fi home
|
||||||
MultiSelectListPreference pref_wifi_homes = (MultiSelectListPreference) screen.findPreference("wifi_homes");
|
MultiSelectListPreference pref_wifi_homes = (MultiSelectListPreference) screen.findPreference("wifi_homes");
|
||||||
Set<String> ssid = prefs.getStringSet("wifi_homes", new HashSet<String>());
|
Set<String> ssid = prefs.getStringSet("wifi_homes", new HashSet<String>());
|
||||||
|
@ -131,6 +123,14 @@ public class ActivitySettings extends AppCompatActivity implements SharedPrefere
|
||||||
Preference pref_auto_enable = screen.findPreference("auto_enable");
|
Preference pref_auto_enable = screen.findPreference("auto_enable");
|
||||||
pref_auto_enable.setTitle(getString(R.string.setting_auto, prefs.getString("auto_enable", "0")));
|
pref_auto_enable.setTitle(getString(R.string.setting_auto, prefs.getString("auto_enable", "0")));
|
||||||
|
|
||||||
|
// Handle stats
|
||||||
|
EditTextPreference pref_stats_base = (EditTextPreference) screen.findPreference("stats_base");
|
||||||
|
EditTextPreference pref_stats_frequency = (EditTextPreference) screen.findPreference("stats_frequency");
|
||||||
|
EditTextPreference pref_stats_samples = (EditTextPreference) screen.findPreference("stats_samples");
|
||||||
|
pref_stats_base.setTitle(getString(R.string.setting_stats_base, prefs.getString("stats_base", "5")));
|
||||||
|
pref_stats_frequency.setTitle(getString(R.string.setting_stats_frequency, prefs.getString("stats_frequency", "1000")));
|
||||||
|
pref_stats_samples.setTitle(getString(R.string.setting_stats_samples, prefs.getString("stats_samples", "90")));
|
||||||
|
|
||||||
// Handle export
|
// Handle export
|
||||||
Preference pref_export = screen.findPreference("export");
|
Preference pref_export = screen.findPreference("export");
|
||||||
pref_export.setEnabled(getIntentCreateDocument().resolveActivity(getPackageManager()) != null);
|
pref_export.setEnabled(getIntentCreateDocument().resolveActivity(getPackageManager()) != null);
|
||||||
|
|
|
@ -72,7 +72,7 @@
|
||||||
android:title="@string/setting_national_roaming" />
|
android:title="@string/setting_national_roaming" />
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
<PreferenceCategory
|
<PreferenceCategory
|
||||||
android:key="category_options"
|
android:key="category_stats"
|
||||||
android:title="@string/setting_stats_category">
|
android:title="@string/setting_stats_category">
|
||||||
<SwitchPreference
|
<SwitchPreference
|
||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
|
|
Loading…
Reference in a new issue