Merge pull request #1535 from osodebailar/fix/final-fix-for-cgm_iconcolor

final fix for cgm iconcolor
This commit is contained in:
Milos Kozak 2022-04-02 13:44:38 +02:00 committed by GitHub
commit d4b56345e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 2 deletions

View file

@ -5,8 +5,9 @@ import android.app.NotificationManager
import android.content.ActivityNotFoundException import android.content.ActivityNotFoundException
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.graphics.Color
import android.graphics.Paint import android.graphics.Paint
import android.graphics.PorterDuff
import android.graphics.PorterDuffColorFilter
import android.graphics.drawable.AnimationDrawable import android.graphics.drawable.AnimationDrawable
import android.os.Build import android.os.Build
import android.os.Bundle 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() binding.buttonsLayout.calibrationButton.visibility = (xDripIsBgSource && actualBG != null && sp.getBoolean(R.string.key_show_calibration_button, true)).toVisibility()
if (dexcomIsSource) { if (dexcomIsSource) {
binding.buttonsLayout.cgmButton.setCompoundDrawablesWithIntrinsicBounds(null, rh.gd(R.drawable.ic_byoda), null, null) 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)) binding.buttonsLayout.cgmButton.setTextColor(rh.gac(context, R.attr.cgmdexColor))
} else if (xDripIsBgSource) { } else if (xDripIsBgSource) {
binding.buttonsLayout.cgmButton.setCompoundDrawablesWithIntrinsicBounds(null, rh.gd(R.drawable.ic_xdrip), null, null) 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.setTextColor(rh.gac(context, R.attr.cgmxdripColor))
} }
binding.buttonsLayout.cgmButton.visibility = (sp.getBoolean(R.string.key_show_cgm_button, false) && (xDripIsBgSource || dexcomIsSource)).toVisibility() binding.buttonsLayout.cgmButton.visibility = (sp.getBoolean(R.string.key_show_cgm_button, false) && (xDripIsBgSource || dexcomIsSource)).toVisibility()

View file

@ -4,6 +4,6 @@
android:viewportHeight="24" android:viewportHeight="24"
android:viewportWidth="24" android:viewportWidth="24"
xmlns:android="http://schemas.android.com/apk/res/android"> xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="?attr/icCalibrationColor" <path android:fillColor="@color/calibration"
android:pathData="M12.143,3.619c1.326,1.335 2.613,2.639 3.908,3.934c0.86,0.86 1.735,1.695 2.294,2.811c1.242,2.477 0.847,5.53 -1.039,7.698c-1.763,2.026 -4.813,2.845 -7.35,1.973c-4.996,-1.716 -6.424,-7.776 -2.71,-11.543C8.837,6.878 10.458,5.294 12.143,3.619zM12.08,6.135c-1.258,1.251 -2.447,2.427 -3.628,3.61c-1.148,1.149 -1.65,2.542 -1.541,4.158c0.177,2.618 2.665,4.888 5.169,4.688C12.08,14.471 12.08,10.35 12.08,6.135z"/> android:pathData="M12.143,3.619c1.326,1.335 2.613,2.639 3.908,3.934c0.86,0.86 1.735,1.695 2.294,2.811c1.242,2.477 0.847,5.53 -1.039,7.698c-1.763,2.026 -4.813,2.845 -7.35,1.973c-4.996,-1.716 -6.424,-7.776 -2.71,-11.543C8.837,6.878 10.458,5.294 12.143,3.619zM12.08,6.135c-1.258,1.251 -2.447,2.427 -3.628,3.61c-1.148,1.149 -1.65,2.542 -1.541,4.158c0.177,2.618 2.665,4.888 5.169,4.688C12.08,14.471 12.08,10.35 12.08,6.135z"/>
</vector> </vector>

View file

@ -63,6 +63,9 @@
<color name="examinedProfile">#FFFF5555</color> <color name="examinedProfile">#FFFF5555</color>
<color name="defaulttext">#BBBBBB</color> <color name="defaulttext">#BBBBBB</color>
<!-- Datepicker-->
<color name="dateTimePickerBackground">@color/buttonBackground</color>
<!-- Treatment--> <!-- Treatment-->
<color name="tempbasal">#C803A9F4</color> <color name="tempbasal">#C803A9F4</color>
<color name="list_delimiter">#505050</color> <color name="list_delimiter">#505050</color>

View file

@ -64,6 +64,9 @@
<color name="examinedProfile">#FFFF5555</color> <color name="examinedProfile">#FFFF5555</color>
<color name="defaulttext">#BBBBBB</color> <color name="defaulttext">#BBBBBB</color>
<!-- Datepicker-->
<color name="dateTimePickerBackground">@color/white</color>
<!-- Treatment--> <!-- Treatment-->
<color name="tempbasal">#C803A9F4</color> <color name="tempbasal">#C803A9F4</color>
<color name="list_delimiter">#505050</color> <color name="list_delimiter">#505050</color>