Remove the amount of carbs required from the main overview if a carb treatment has been made after APS run

This commit is contained in:
Tim Gunn 2020-06-27 01:03:25 +12:00
parent d04cf567b8
commit 2391ebe399
No known key found for this signature in database
GPG key ID: C9BC1E9D0D0AED8C

View file

@ -748,13 +748,16 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
if (config.APS && lastRun?.constraintsProcessed != null) {
if (lastRun.constraintsProcessed!!.carbsReq > 0) {
overview_cob?.text = cobText + " | " + lastRun.constraintsProcessed!!.carbsReq + " " + resourceHelper.gs(R.string.required)
//only display carbsreq when carbs havnt been entered recently
if (treatmentsPlugin.lastCarbTime < lastRun.lastAPSRun){
cobText = cobText + " | " + lastRun.constraintsProcessed!!.carbsReq + " " + resourceHelper.gs(R.string.required)
}
overview_cob?.text = cobText
if (!carbAnimation.isRunning)
carbAnimation.start()
} else {
overview_cob?.text = cobText
if (carbAnimation.isRunning)
carbAnimation.stop()
carbAnimation.stop()
carbAnimation.selectDrawable(0);
}
}