diff --git a/core/main/src/main/java/info/nightscout/core/iob/CobInfoExtension.kt b/core/main/src/main/java/info/nightscout/core/iob/CobInfoExtension.kt index a9cf10b23e..e2aa5f329b 100644 --- a/core/main/src/main/java/info/nightscout/core/iob/CobInfoExtension.kt +++ b/core/main/src/main/java/info/nightscout/core/iob/CobInfoExtension.kt @@ -3,7 +3,6 @@ package info.nightscout.core.iob import info.nightscout.interfaces.iob.CobInfo import info.nightscout.interfaces.utils.DecimalFormatter import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.utils.DateUtil fun CobInfo.generateCOBString(): String { var cobStringResult = "--g" @@ -16,11 +15,9 @@ fun CobInfo.generateCOBString(): String { return cobStringResult } -fun CobInfo.displayText(rh: ResourceHelper, dateUtil: DateUtil, isDev: Boolean): String? = +fun CobInfo.displayText(rh: ResourceHelper): String? = displayCob?.let { displayCob -> var cobText = rh.gs(info.nightscout.core.ui.R.string.format_carbs, displayCob.toInt()) if (futureCarbs > 0) cobText += "(" + DecimalFormatter.to0Decimal(futureCarbs) + ")" - // This is only temporary for debugging - if (isDev) cobText += "\n" + dateUtil.timeString(timestamp) cobText } diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/overview/OverviewFragment.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/overview/OverviewFragment.kt index e4714d1079..9eaf02fcb7 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/general/overview/OverviewFragment.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/general/overview/OverviewFragment.kt @@ -914,7 +914,7 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList private fun updateIobCob() { val iobText = overviewData.iobText(iobCobCalculator) val iobDialogText = overviewData.iobDialogText(iobCobCalculator) - val displayText = overviewData.cobInfo(iobCobCalculator).displayText(rh, dateUtil, config.isEngineeringMode()) + val displayText = overviewData.cobInfo(iobCobCalculator).displayText(rh) val lastCarbsTime = overviewData.lastCarbsTime runOnUiThread { _binding ?: return@runOnUiThread @@ -929,7 +929,7 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList if (constraintsProcessed.carbsReq > 0) { //only display carbsreq when carbs have not been entered recently if (lastCarbsTime < lastRun.lastAPSRun) { - cobText += " | " + constraintsProcessed.carbsReq + " " + rh.gs(info.nightscout.core.ui.R.string.required) + cobText += "\n" + constraintsProcessed.carbsReq + " " + rh.gs(info.nightscout.core.ui.R.string.required) } if (carbAnimation?.isRunning == false) carbAnimation?.start() diff --git a/ui/src/main/java/info/nightscout/ui/widget/Widget.kt b/ui/src/main/java/info/nightscout/ui/widget/Widget.kt index aa5cccfc8f..9ac5fbcc74 100644 --- a/ui/src/main/java/info/nightscout/ui/widget/Widget.kt +++ b/ui/src/main/java/info/nightscout/ui/widget/Widget.kt @@ -181,7 +181,7 @@ class Widget : AppWidgetProvider() { private fun updateIobCob(views: RemoteViews) { views.setTextViewText(R.id.iob, overviewData.iobText(iobCobCalculator)) // cob - var cobText = overviewData.cobInfo(iobCobCalculator).displayText(rh, dateUtil, isDev = false) ?: rh.gs(info.nightscout.core.ui.R.string.value_unavailable_short) + var cobText = overviewData.cobInfo(iobCobCalculator).displayText(rh) ?: rh.gs(info.nightscout.core.ui.R.string.value_unavailable_short) val constraintsProcessed = loop.lastRun?.constraintsProcessed val lastRun = loop.lastRun