From a4f48949856dbf7ae469caaebeb99123fdf0c765 Mon Sep 17 00:00:00 2001 From: Tim Gunn <2896311+Tornado-Tim@users.noreply.github.com> Date: Mon, 11 May 2020 21:54:32 +1200 Subject: [PATCH] fixes --- .../general/overview/OverviewFragment.kt | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 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 13bd366638..663bc52c6b 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 @@ -187,10 +187,9 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList overview_bggraph?.gridLabelRenderer?.reloadStyles() overview_bggraph?.gridLabelRenderer?.labelVerticalWidth = axisWidth - val carbicon = overview_carbs_icon; - carbAnimation = carbicon.background as AnimationDrawable - carbAnimation.setEnterFadeDuration(1200); - carbAnimation.setExitFadeDuration(1200); + carbAnimation = overview_carbs_icon.background as AnimationDrawable + carbAnimation.setEnterFadeDuration(1200) + carbAnimation.setExitFadeDuration(1200) rangeToDisplay = sp.getInt(R.string.key_rangetodisplay, 6) @@ -683,7 +682,7 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList if (activeTemp != null) overview_basebasal_icon.setImageResource(if (activeTemp.tempBasalConvertedToPercent(System.currentTimeMillis(), profile) > 100) R.drawable.icon_cp_basal_tbr_high else R.drawable.icon_cp_basal_tbr_low) else - overview_basebasal_icon.setImageResource( R.drawable.icon_cp_basal_no_tbr ) + overview_basebasal_icon.setImageResource(R.drawable.icon_cp_basal_no_tbr) // Extended bolus val extendedBolus = treatmentsPlugin.getExtendedBolusFromHistory(System.currentTimeMillis()) @@ -748,14 +747,14 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList val lastRun = loopPlugin.lastRun if (config.APS && lastRun?.constraintsProcessed != null && lastRun?.constraintsProcessed.carbsReq > 0) { - overview_cob?.text = cobText + " ("+lastRun?.constraintsProcessed.carbsReq + " req)" - if(!carbAnimation.isRunning) + overview_cob?.text = cobText + " *" + lastRun?.constraintsProcessed.carbsReq + " "+R.string.required+"*" + if (!carbAnimation.isRunning) carbAnimation.start() - }else{ + } else { overview_cob?.text = cobText - if(carbAnimation.isRunning) + if (carbAnimation.isRunning) carbAnimation.stop() - carbAnimation.selectDrawable(0); + carbAnimation.selectDrawable(0); } val predictionsAvailable = if (config.APS) lastRun?.request?.hasPredictions == true else config.NSCLIENT