From 1b50b43fbb50b614bd5a1d52e159c3fc31703bee Mon Sep 17 00:00:00 2001 From: Johannes Mockenhaupt Date: Tue, 21 Nov 2017 00:21:56 +0100 Subject: [PATCH] Add headers to dialogs. --- TODO-Combo.md | 1 + .../plugins/PumpCombo/ComboPlugin.java | 1 + .../layout/combo_error_history_fragment.xml | 28 +++++++++++ .../res/layout/combo_tdd_history_fragment.xml | 50 +++++++++++++++---- .../java/de/jotomo/ruffy/spi/history/Tdd.java | 2 +- 5 files changed, 70 insertions(+), 12 deletions(-) diff --git a/TODO-Combo.md b/TODO-Combo.md index a0a4300a26..74792b375b 100644 --- a/TODO-Combo.md +++ b/TODO-Combo.md @@ -1,6 +1,7 @@ - [ ] Bugs - [ ] Taking over benign warnings on connect doesn't work properly (Notification raised but not confirmed?) + - [ ] Reading full history multiple times duplicates entries shown in Stats/TDD dialog - [x] ruffy: Accessing the quick info menu yields noMenu when cartridge is low - [x] ruffy: Multi-digit error codes in error history aren't supported - [-] No connection can be established anymore; ruffy issue i can't solve diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java index b598b43aa3..11975cdde8 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java @@ -226,6 +226,7 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf } CommandResult commandResult = runCommand(MainApp.sResources.getString(R.string.combo_activity_setting_basal_profile), 2, () -> ruffyScripter.setBasalProfile(basalProfile)); + // Note: no verification here, command checks summary of inputs (total basal) at the end return commandResult.success ? PumpInterface.SUCCESS : PumpInterface.FAILED;*/ } diff --git a/app/src/main/res/layout/combo_error_history_fragment.xml b/app/src/main/res/layout/combo_error_history_fragment.xml index ee6c546ca6..581a317deb 100644 --- a/app/src/main/res/layout/combo_error_history_fragment.xml +++ b/app/src/main/res/layout/combo_error_history_fragment.xml @@ -4,6 +4,32 @@ android:layout_height="match_parent" tools:context=".plugins.PumpCombo.ComboFragment"> + + + + + + + @@ -24,4 +50,6 @@ + + diff --git a/app/src/main/res/layout/combo_tdd_history_fragment.xml b/app/src/main/res/layout/combo_tdd_history_fragment.xml index 856521cf4e..69ca8a2555 100644 --- a/app/src/main/res/layout/combo_tdd_history_fragment.xml +++ b/app/src/main/res/layout/combo_tdd_history_fragment.xml @@ -4,24 +4,52 @@ android:layout_height="match_parent" tools:context=".plugins.PumpCombo.ComboFragment"> - + android:layout_height="match_parent" + android:orientation="vertical"> - + android:layout_gravity="center_horizontal" + android:gravity="center_horizontal" + android:layout_marginTop="5dp" + android:text="TDD" + android:textStyle="bold" /> - + + + + - + android:orientation="vertical"> + + + + + + + - diff --git a/ruffy-spi/src/main/java/de/jotomo/ruffy/spi/history/Tdd.java b/ruffy-spi/src/main/java/de/jotomo/ruffy/spi/history/Tdd.java index d1d68ab7c2..58c3ac4c4d 100644 --- a/ruffy-spi/src/main/java/de/jotomo/ruffy/spi/history/Tdd.java +++ b/ruffy-spi/src/main/java/de/jotomo/ruffy/spi/history/Tdd.java @@ -19,7 +19,7 @@ public class Tdd extends HistoryRecord { Tdd tdd = (Tdd) o; if (timestamp != tdd.timestamp) return false; - return Math.abs(tdd.total - total) <= 0.05; + return tdd.total != total; } @Override