From 612efa6a133a9ff2edda71df7a4061d08da3d402 Mon Sep 17 00:00:00 2001 From: Johannes Mockenhaupt Date: Sat, 9 Sep 2017 18:16:13 +0200 Subject: [PATCH] Revert "Make the BolusProgress dialog a bit more self-contained." Breaks dismissal of dialog (only one invocation of EventDismissBolusprogressIfRunning also sets bolusEnded=true). This reverts commit c11455dff1f72ade66313b7725929141f5689aea. --- .../plugins/ConfigBuilder/ConfigBuilderPlugin.java | 1 + .../plugins/Overview/Dialogs/BolusProgressDialog.java | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java index af5eeb6376..aa603286f4 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java @@ -455,6 +455,7 @@ public class ConfigBuilderPlugin implements PluginBase, PumpInterface, Constrain result = activePump.deliverTreatment(detailedBolusInfo); + BolusProgressDialog.bolusEnded = true; MainApp.bus().post(new EventDismissBolusprogressIfRunning(result)); mWakeLock.release(); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/BolusProgressDialog.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/BolusProgressDialog.java index 50a2a8b50f..192bffba3c 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/BolusProgressDialog.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/BolusProgressDialog.java @@ -33,8 +33,8 @@ public class BolusProgressDialog extends DialogFragment implements View.OnClickL BolusProgressHelperActivity helperActivity; static double amount; - private static boolean bolusEnded = false; - private static boolean running = true; + public static boolean bolusEnded = false; + public static boolean running = true; public BolusProgressDialog() { super(); @@ -124,7 +124,6 @@ public class BolusProgressDialog extends DialogFragment implements View.OnClickL @Subscribe public void onStatusEvent(final EventDismissBolusprogressIfRunning ev) { if(BolusProgressDialog.running){ - bolusEnded = true; dismiss(); } }