refractor

This commit is contained in:
Tim Gunn 2020-05-21 04:19:22 +12:00
parent 723c029228
commit bf412ea798
No known key found for this signature in database
GPG key ID: C9BC1E9D0D0AED8C

View file

@ -659,11 +659,9 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
//show this change to the user if it exists //show this change to the user if it exists
var targetused = lastRun?.constraintsProcessed?.targetBG var targetused = lastRun?.constraintsProcessed?.targetBG
if (targetused != null && targetused != 0.0) { if (targetused != null && targetused != 0.0) {
if (units == Constants.MMOL)
targetused *= Constants.MGDL_TO_MMOLL
if (profile.targetUnits != targetused) { if (((profile.targetLowMgdl+profile.targetHighMgdl)/2)!= targetused) {
overview_temptarget?.text = targetused.toString() overview_temptarget?.text = Profile.toTargetRangeString(targetused, targetused, Constants.MGDL, units)
overview_temptarget?.setTextColor(resourceHelper.gc(R.color.ribbonTextWarning)) overview_temptarget?.setTextColor(resourceHelper.gc(R.color.ribbonTextWarning))
overview_temptarget?.setBackgroundColor(resourceHelper.gc(R.color.tempTargetBackground)) overview_temptarget?.setBackgroundColor(resourceHelper.gc(R.color.tempTargetBackground))
} else { } else {