From 950b638e502ec898190951df93af13ccd2969935 Mon Sep 17 00:00:00 2001 From: AdrianLxM Date: Tue, 24 Jan 2017 10:28:42 +0100 Subject: [PATCH] Advanced Settings --- .../info/nightscout/androidaps/Constants.java | 2 +- .../androidaps/PreferencesActivity.java | 1 + .../androidaps/data/GlucoseStatus.java | 2 +- app/src/main/res/values/strings.xml | 3 +- app/src/main/res/xml/pref_advanced.xml | 30 +++++++++++++++++++ app/src/main/res/xml/pref_nightscout.xml | 10 ------- app/src/main/res/xml/pref_openapsma.xml | 13 -------- 7 files changed, 34 insertions(+), 27 deletions(-) create mode 100644 app/src/main/res/xml/pref_advanced.xml diff --git a/app/src/main/java/info/nightscout/androidaps/Constants.java b/app/src/main/java/info/nightscout/androidaps/Constants.java index 27e650edbe..77c8e2b9a0 100644 --- a/app/src/main/java/info/nightscout/androidaps/Constants.java +++ b/app/src/main/java/info/nightscout/androidaps/Constants.java @@ -53,7 +53,7 @@ public class Constants { // Very Hard Limits Ranges // First value is the Lowest and second value is the Highest a Limit can define public static final int[] VERY_HARD_LIMIT_MIN_BG = {72,180}; - public static final int[] VERY_HARD_LIMIT_MAX_BG = {99,270}; + public static final int[] VERY_HARD_LIMIT_MAX_BG = {90,270}; public static final int[] VERY_HARD_LIMIT_TARGET_BG = {80,200}; // Very Hard Limits Ranges for Temp Targets diff --git a/app/src/main/java/info/nightscout/androidaps/PreferencesActivity.java b/app/src/main/java/info/nightscout/androidaps/PreferencesActivity.java index 92965a466f..858d7fde6e 100644 --- a/app/src/main/java/info/nightscout/androidaps/PreferencesActivity.java +++ b/app/src/main/java/info/nightscout/androidaps/PreferencesActivity.java @@ -104,6 +104,7 @@ public class PreferencesActivity extends PreferenceActivity implements SharedPre if (Config.SMSCOMMUNICATORENABLED) addPreferencesFromResource(R.xml.pref_smscommunicator); addPreferencesFromResource(R.xml.pref_others); + addPreferencesFromResource(R.xml.pref_advanced); initSummary(getPreferenceScreen()); } diff --git a/app/src/main/java/info/nightscout/androidaps/data/GlucoseStatus.java b/app/src/main/java/info/nightscout/androidaps/data/GlucoseStatus.java index c88d17ca38..113b3dc25c 100644 --- a/app/src/main/java/info/nightscout/androidaps/data/GlucoseStatus.java +++ b/app/src/main/java/info/nightscout/androidaps/data/GlucoseStatus.java @@ -112,7 +112,7 @@ public class GlucoseStatus { status.short_avgdelta = average(short_deltas); - if(prefs.getBoolean("always_use_shortavg",false) || (last_deltas.isEmpty() && prefs.getBoolean("default_to_shortavg",false))){ + if(prefs.getBoolean("always_use_shortavg",false) || last_deltas.isEmpty()){ status.delta = status.short_avgdelta; } else { status.delta = average(last_deltas); diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 0045693f75..8d469bf73c 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -449,8 +449,7 @@ SMS Shorten tab titles Delta Settings - Default to short average delta - Use short average delta when simple delta cannot be computed. Always use short average delta instead of simple delta Useful when data from unfiltered sources like xDrip gets noisy. + Advanced Settings diff --git a/app/src/main/res/xml/pref_advanced.xml b/app/src/main/res/xml/pref_advanced.xml new file mode 100644 index 0000000000..61552cb3be --- /dev/null +++ b/app/src/main/res/xml/pref_advanced.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + diff --git a/app/src/main/res/xml/pref_nightscout.xml b/app/src/main/res/xml/pref_nightscout.xml index 937ba32aa5..6bdf24f309 100644 --- a/app/src/main/res/xml/pref_nightscout.xml +++ b/app/src/main/res/xml/pref_nightscout.xml @@ -8,16 +8,6 @@ android:defaultValue="false" android:key="syncprofiletopump" android:title="@string/syncprofiletopump_title" /> - - - \ No newline at end of file diff --git a/app/src/main/res/xml/pref_openapsma.xml b/app/src/main/res/xml/pref_openapsma.xml index cddb62531b..2cb9d3164b 100644 --- a/app/src/main/res/xml/pref_openapsma.xml +++ b/app/src/main/res/xml/pref_openapsma.xml @@ -30,18 +30,5 @@ android:key="openapsma_max_iob" android:numeric="decimal" android:title="@string/openapsma_maxiob_summary" /> - - - - \ No newline at end of file