From ef21a068a98d0239348cdaf77a2272934ea2899d Mon Sep 17 00:00:00 2001 From: Philoul Date: Fri, 11 Dec 2020 14:06:59 +0100 Subject: [PATCH] Improve vertical position of apsmode icon apsmode_text TextView visible only if necessary --- .../plugins/general/overview/OverviewFragment.kt | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 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 4cf9f304ca..dbc0195fee 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 @@ -612,16 +612,19 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList loopPlugin.isEnabled() && loopPlugin.isSuperBolus -> { overview_apsmode?.setImageResource(R.drawable.ic_loop_superbolus) overview_apsmode_text?.text = DateUtil.age(loopPlugin.minutesToEndOfSuspend() * 60000L, true, resourceHelper) + overview_apsmode_text?.visibility = View.VISIBLE } loopPlugin.isDisconnected -> { overview_apsmode?.setImageResource(R.drawable.ic_loop_disconnected) overview_apsmode_text?.text = DateUtil.age(loopPlugin.minutesToEndOfSuspend() * 60000L, true, resourceHelper) + overview_apsmode_text?.visibility = View.VISIBLE } loopPlugin.isEnabled() && loopPlugin.isSuspended -> { overview_apsmode?.setImageResource(R.drawable.ic_loop_paused) overview_apsmode_text?.text = DateUtil.age(loopPlugin.minutesToEndOfSuspend() * 60000L, true, resourceHelper) + overview_apsmode_text?.visibility = View.VISIBLE } pump.isSuspended -> { @@ -632,27 +635,27 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList } else { R.drawable.ic_loop_paused }) - overview_apsmode_text?.text = "" + overview_apsmode_text?.visibility = View.GONE } loopPlugin.isEnabled() && closedLoopEnabled.value() && loopPlugin.isLGS -> { overview_apsmode?.setImageResource(R.drawable.ic_loop_lgs) - overview_apsmode_text?.text = "" + overview_apsmode_text?.visibility = View.GONE } loopPlugin.isEnabled() && closedLoopEnabled.value() -> { overview_apsmode?.setImageResource(R.drawable.ic_loop_closed) - overview_apsmode_text?.text = "" + overview_apsmode_text?.visibility = View.GONE } loopPlugin.isEnabled() && !closedLoopEnabled.value() -> { overview_apsmode?.setImageResource(R.drawable.ic_loop_open) - overview_apsmode_text?.text = "" + overview_apsmode_text?.visibility = View.GONE } else -> { overview_apsmode?.setImageResource(R.drawable.ic_loop_disabled) - overview_apsmode_text?.text = "" + overview_apsmode_text?.visibility = View.GONE } } } else {