From ea594583831fc5acaae1a876ae254261b92cf0ae Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Sat, 21 Apr 2018 20:46:55 +0200 Subject: [PATCH] nsclient preferences cleanup --- .../androidaps/PreferencesActivity.java | 7 +- .../main/res/xml/pref_nsclientinternal.xml | 82 ++++++++++--------- 2 files changed, 45 insertions(+), 44 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/PreferencesActivity.java b/app/src/main/java/info/nightscout/androidaps/PreferencesActivity.java index b6b117381f..52984d3697 100644 --- a/app/src/main/java/info/nightscout/androidaps/PreferencesActivity.java +++ b/app/src/main/java/info/nightscout/androidaps/PreferencesActivity.java @@ -67,7 +67,7 @@ public class PreferencesActivity extends PreferenceActivity implements SharedPre MainApp.bus().post(new EventRefreshGui()); } if (key.equals(MainApp.gs(R.string.key_openapsama_useautosens)) && SP.getBoolean(R.string.key_openapsama_useautosens, false)) { - OKDialog.show(this, MainApp.sResources.getString(R.string.configbuilder_sensitivity), MainApp.sResources.getString(R.string.sensitivity_warning), null); + OKDialog.show(this, MainApp.gs(R.string.configbuilder_sensitivity), MainApp.gs(R.string.sensitivity_warning), null); } updatePrefSummary(myPreferenceFragment.getPreference(key)); } @@ -81,13 +81,13 @@ public class PreferencesActivity extends PreferenceActivity implements SharedPre EditTextPreference editTextPref = (EditTextPreference) pref; if (pref.getKey().contains("password") || pref.getKey().contains("secret")) { pref.setSummary("******"); - } else if (pref.getKey().equals(MainApp.sResources.getString(R.string.key_danars_name))) { + } else if (pref.getKey().equals(MainApp.gs(R.string.key_danars_name))) { pref.setSummary(SP.getString(R.string.key_danars_name, "")); } else if (editTextPref.getText() != null && !editTextPref.getText().equals("")) { ((EditTextPreference) pref).setDialogMessage(editTextPref.getDialogMessage()); pref.setSummary(editTextPref.getText()); } else if (pref.getKey().contains("smscommunicator_allowednumbers") && TextUtils.isEmpty(editTextPref.getText().trim())) { - pref.setSummary(MainApp.sResources.getString(R.string.smscommunicator_allowednumbers_summary)); + pref.setSummary(MainApp.gs(R.string.smscommunicator_allowednumbers_summary)); } } } @@ -127,7 +127,6 @@ public class PreferencesActivity extends PreferenceActivity implements SharedPre if (id != -1) { addPreferencesFromResource(id); - addPreferencesFromResource(R.xml.pref_advanced); } else { addPreferencesFromResource(R.xml.pref_overview); diff --git a/app/src/main/res/xml/pref_nsclientinternal.xml b/app/src/main/res/xml/pref_nsclientinternal.xml index f6972cd179..f07251929a 100644 --- a/app/src/main/res/xml/pref_nsclientinternal.xml +++ b/app/src/main/res/xml/pref_nsclientinternal.xml @@ -2,7 +2,6 @@ - - - - - - - + android:title="@string/nsalarm_urgenthigh" /> + android:title="@string/nsalarm_high" /> - + android:title="@string/nsalarm_low" /> + android:title="@string/nsalarm_urgentlow" /> + android:title="@string/nsalarm_staledata" /> + validate:maxNumber="120" + validate:minNumber="15" + validate:testType="numericRange" /> + android:title="@string/nsalarm_urgentstaledata" /> + validate:maxNumber="180" + validate:minNumber="30" + validate:testType="numericRange" /> + + + + + + + + + +