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 28cf943774..5d571e61a9 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 @@ -5,8 +5,9 @@ import android.app.NotificationManager import android.content.ActivityNotFoundException import android.content.Context import android.content.Intent -import android.graphics.Color import android.graphics.Paint +import android.graphics.PorterDuff +import android.graphics.PorterDuffColorFilter import android.graphics.drawable.AnimationDrawable import android.os.Build import android.os.Bundle @@ -560,9 +561,17 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList binding.buttonsLayout.calibrationButton.visibility = (xDripIsBgSource && actualBG != null && sp.getBoolean(R.string.key_show_calibration_button, true)).toVisibility() if (dexcomIsSource) { binding.buttonsLayout.cgmButton.setCompoundDrawablesWithIntrinsicBounds(null, rh.gd(R.drawable.ic_byoda), null, null) + for (drawable in binding.buttonsLayout.cgmButton.compoundDrawables) { + drawable?.mutate() + drawable?.colorFilter = PorterDuffColorFilter(rh.gac( context,R.attr.cgmdexColor ), PorterDuff.Mode.SRC_IN) + } binding.buttonsLayout.cgmButton.setTextColor(rh.gac(context, R.attr.cgmdexColor)) } else if (xDripIsBgSource) { binding.buttonsLayout.cgmButton.setCompoundDrawablesWithIntrinsicBounds(null, rh.gd(R.drawable.ic_xdrip), null, null) + for (drawable in binding.buttonsLayout.cgmButton.compoundDrawables) { + drawable?.mutate() + drawable?.colorFilter = PorterDuffColorFilter(rh.gac( context,R.attr.cgmxdripColor ), PorterDuff.Mode.SRC_IN) + } binding.buttonsLayout.cgmButton.setTextColor(rh.gac(context, R.attr.cgmxdripColor)) } binding.buttonsLayout.cgmButton.visibility = (sp.getBoolean(R.string.key_show_cgm_button, false) && (xDripIsBgSource || dexcomIsSource)).toVisibility() diff --git a/app/src/main/res/drawable/ic_xdrip.xml b/app/src/main/res/drawable/ic_xdrip.xml index bf2ee9b482..b144f6335f 100644 --- a/app/src/main/res/drawable/ic_xdrip.xml +++ b/app/src/main/res/drawable/ic_xdrip.xml @@ -4,6 +4,6 @@ android:viewportHeight="24" android:viewportWidth="24" xmlns:android="http://schemas.android.com/apk/res/android"> - diff --git a/core/src/main/res/values-night/colors.xml b/core/src/main/res/values-night/colors.xml index ba771afa38..6641aef07f 100644 --- a/core/src/main/res/values-night/colors.xml +++ b/core/src/main/res/values-night/colors.xml @@ -63,6 +63,9 @@ #FFFF5555 #BBBBBB + + @color/buttonBackground + #C803A9F4 #505050 diff --git a/core/src/main/res/values/colors.xml b/core/src/main/res/values/colors.xml index ca608ef91c..9575733f83 100644 --- a/core/src/main/res/values/colors.xml +++ b/core/src/main/res/values/colors.xml @@ -64,6 +64,9 @@ #FFFF5555 #BBBBBB + + @color/white + #C803A9F4 #505050