Simplify code
This commit is contained in:
parent
61017e1b54
commit
9145a11563
1 changed files with 2 additions and 2 deletions
|
@ -557,10 +557,10 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
|
||||||
val xDripIsBgSource = xdripPlugin.isEnabled()
|
val xDripIsBgSource = xdripPlugin.isEnabled()
|
||||||
val dexcomIsSource = dexcomPlugin.isEnabled()
|
val dexcomIsSource = dexcomPlugin.isEnabled()
|
||||||
binding.buttonsLayout.calibrationButton.visibility = ((xDripIsBgSource || dexcomIsSource) && actualBG != null && sp.getBoolean(R.string.key_show_calibration_button, true)).toVisibility()
|
binding.buttonsLayout.calibrationButton.visibility = ((xDripIsBgSource || dexcomIsSource) && actualBG != null && sp.getBoolean(R.string.key_show_calibration_button, true)).toVisibility()
|
||||||
if (dexcomPlugin.isEnabled()) {
|
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)
|
||||||
binding.buttonsLayout.cgmButton.setTextColor(rh.gc(R.color.white))
|
binding.buttonsLayout.cgmButton.setTextColor(rh.gc(R.color.white))
|
||||||
} else if (xdripPlugin.isEnabled()) {
|
} 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)
|
||||||
binding.buttonsLayout.cgmButton.setTextColor(rh.gc(R.color.colorCalibrationButton))
|
binding.buttonsLayout.cgmButton.setTextColor(rh.gc(R.color.colorCalibrationButton))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue