diff --git a/app/src/main/java/info/nightscout/androidaps/data/PumpEnactResult.java b/app/src/main/java/info/nightscout/androidaps/data/PumpEnactResult.java index c50166d5a4..d19b3316ac 100644 --- a/app/src/main/java/info/nightscout/androidaps/data/PumpEnactResult.java +++ b/app/src/main/java/info/nightscout/androidaps/data/PumpEnactResult.java @@ -57,6 +57,10 @@ public class PumpEnactResult extends Object { return this; } + public PumpEnactResult percent(Integer percent) { + this.percent = percent; + return this; + } public PumpEnactResult isPercent(boolean isPercent) { this.isPercent = isPercent; return this; @@ -111,7 +115,7 @@ public class PumpEnactResult extends Object { } public Spanned toSpanned() { - String ret = MainApp.sResources.getString(R.string.success) + ": " + success; + String ret = "" + MainApp.sResources.getString(R.string.success) + ": " + success; if (queued) { ret = MainApp.sResources.getString(R.string.waitingforpumpresult); } else if (enacted) { @@ -119,17 +123,20 @@ public class PumpEnactResult extends Object { ret += "
" + MainApp.sResources.getString(R.string.enacted) + ": " + enacted; ret += "
" + MainApp.sResources.getString(R.string.comment) + ": " + comment + "
" + MainApp.sResources.getString(R.string.canceltemp); - } else if (isPercent) { + } else if (isPercent && percent != -1) { ret += "
" + MainApp.sResources.getString(R.string.enacted) + ": " + enacted; ret += "
" + MainApp.sResources.getString(R.string.comment) + ": " + comment; ret += "
" + MainApp.sResources.getString(R.string.duration) + ": " + duration + " min"; ret += "
" + MainApp.sResources.getString(R.string.percent) + ": " + percent + "%"; - } else { + } else if (absolute != -1) { ret += "
" + MainApp.sResources.getString(R.string.enacted) + ": " + enacted; ret += "
" + MainApp.sResources.getString(R.string.comment) + ": " + comment; ret += "
" + MainApp.sResources.getString(R.string.duration) + ": " + duration + " min"; ret += "
" + MainApp.sResources.getString(R.string.absolute) + ": " + DecimalFormatter.to2Decimal(absolute) + " U/h"; } + if (bolusDelivered > 0) { + ret += "
" + MainApp.sResources.getString(R.string.bolus) + ": " + DecimalFormatter.to2Decimal(bolusDelivered) + " U"; + } } else { ret += "
" + MainApp.sResources.getString(R.string.comment) + ": " + comment; }