From 61017e1b544e49cd520c8e6115eb631cebc05c68 Mon Sep 17 00:00:00 2001 From: Philoul Date: Mon, 6 Dec 2021 23:48:10 +0100 Subject: [PATCH] Set icon and text color in Overview according to MGC plugin --- .../plugins/general/overview/OverviewFragment.kt | 11 +++++++---- 1 file changed, 7 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 f2115b59f5..cbd3bfbb1d 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 @@ -557,10 +557,13 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList val xDripIsBgSource = xdripPlugin.isEnabled() val dexcomIsSource = dexcomPlugin.isEnabled() binding.buttonsLayout.calibrationButton.visibility = ((xDripIsBgSource || dexcomIsSource) && actualBG != null && sp.getBoolean(R.string.key_show_calibration_button, true)).toVisibility() - if (dexcomPlugin.isEnabled()) - binding.buttonsLayout.cgmButton.setCompoundDrawables(rh.gd(R.drawable.ic_xdrip), null, null, null) - else if (xdripPlugin.isEnabled()) - binding.buttonsLayout.cgmButton.setCompoundDrawables(rh.gd(R.drawable.ic_byoda), null, null, null) + if (dexcomPlugin.isEnabled()) { + binding.buttonsLayout.cgmButton.setCompoundDrawablesWithIntrinsicBounds(null, rh.gd(R.drawable.ic_byoda), null, null) + binding.buttonsLayout.cgmButton.setTextColor(rh.gc(R.color.white)) + } else if (xdripPlugin.isEnabled()) { + binding.buttonsLayout.cgmButton.setCompoundDrawablesWithIntrinsicBounds(null, rh.gd(R.drawable.ic_xdrip), null, null) + binding.buttonsLayout.cgmButton.setTextColor(rh.gc(R.color.colorCalibrationButton)) + } binding.buttonsLayout.cgmButton.visibility = (sp.getBoolean(R.string.key_show_cgm_button, false) && (xDripIsBgSource || dexcomIsSource)).toVisibility() // Automation buttons