From bf412ea798c85488fe28d62c7b69a312f3fae2a6 Mon Sep 17 00:00:00 2001 From: Tim Gunn <2896311+Tornado-Tim@users.noreply.github.com> Date: Thu, 21 May 2020 04:19:22 +1200 Subject: [PATCH] refractor --- .../androidaps/plugins/general/overview/OverviewFragment.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt index 547dc3d85b..3891ba6b7e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt @@ -659,11 +659,9 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList //show this change to the user if it exists var targetused = lastRun?.constraintsProcessed?.targetBG if (targetused != null && targetused != 0.0) { - if (units == Constants.MMOL) - targetused *= Constants.MGDL_TO_MMOLL - if (profile.targetUnits != targetused) { - overview_temptarget?.text = targetused.toString() + if (((profile.targetLowMgdl+profile.targetHighMgdl)/2)!= targetused) { + overview_temptarget?.text = Profile.toTargetRangeString(targetused, targetused, Constants.MGDL, units) overview_temptarget?.setTextColor(resourceHelper.gc(R.color.ribbonTextWarning)) overview_temptarget?.setBackgroundColor(resourceHelper.gc(R.color.tempTargetBackground)) } else {