1
0
Fork 0
mirror of https://github.com/M66B/NetGuard.git synced 2024-12-30 20:05:04 +00:00

Fix, refactoring

This commit is contained in:
M66B 2015-12-14 16:09:18 +01:00
parent 533c1428ef
commit e1bb6536df
2 changed files with 9 additions and 9 deletions

View file

@ -102,14 +102,6 @@ public class ActivitySettings extends AppCompatActivity implements SharedPrefere
PreferenceScreen screen = getPreferenceScreen();
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
MultiSelectListPreference pref_wifi_homes = (MultiSelectListPreference) screen.findPreference("wifi_homes");
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");
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
Preference pref_export = screen.findPreference("export");
pref_export.setEnabled(getIntentCreateDocument().resolveActivity(getPackageManager()) != null);

View file

@ -72,7 +72,7 @@
android:title="@string/setting_national_roaming" />
</PreferenceCategory>
<PreferenceCategory
android:key="category_options"
android:key="category_stats"
android:title="@string/setting_stats_category">
<SwitchPreference
android:defaultValue="false"