ComboFragment: make warning/error bold for a better readability.

On lower DPI devices they're already bold, but on higher DPI devices
the yellow "Low" is hardly discernible from white.

(cherry picked from commit 693ba73)
This commit is contained in:
Johannes Mockenhaupt 2017-12-21 22:43:34 +01:00
parent 6a3184bc39
commit 42418d4146
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1

View file

@ -4,6 +4,7 @@ package info.nightscout.androidaps.plugins.PumpCombo;
import android.app.Activity; import android.app.Activity;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.graphics.Color; import android.graphics.Color;
import android.graphics.Typeface;
import android.os.Bundle; import android.os.Bundle;
import android.text.Spanned; import android.text.Spanned;
import android.view.LayoutInflater; import android.view.LayoutInflater;
@ -137,11 +138,14 @@ public class ComboFragment extends SubscriberFragment implements View.OnClickLis
if (ps.insulinState == PumpState.EMPTY || ps.batteryState == PumpState.EMPTY if (ps.insulinState == PumpState.EMPTY || ps.batteryState == PumpState.EMPTY
|| ps.activeAlert != null && ps.activeAlert.errorCode != null) { || ps.activeAlert != null && ps.activeAlert.errorCode != null) {
stateView.setTextColor(Color.RED); stateView.setTextColor(Color.RED);
stateView.setTypeface(null, Typeface.BOLD);
} else if (plugin.getPump().state.suspended } else if (plugin.getPump().state.suspended
|| ps.activeAlert != null && ps.activeAlert.warningCode != null) { || ps.activeAlert != null && ps.activeAlert.warningCode != null) {
stateView.setTextColor(Color.YELLOW); stateView.setTextColor(Color.YELLOW);
stateView.setTypeface(null, Typeface.BOLD);
} else { } else {
stateView.setTextColor(Color.WHITE); stateView.setTextColor(Color.WHITE);
stateView.setTypeface(null, Typeface.NORMAL);
} }
// activity // activity
@ -171,12 +175,15 @@ public class ComboFragment extends SubscriberFragment implements View.OnClickLis
if (ps.insulinState == PumpState.LOW) { if (ps.insulinState == PumpState.LOW) {
reservoirView.setTextColor(Color.YELLOW); reservoirView.setTextColor(Color.YELLOW);
reservoirView.setText(R.string.combo_reservoir_low); reservoirView.setText(R.string.combo_reservoir_low);
reservoirView.setTypeface(null, Typeface.BOLD);
} else if (ps.insulinState == PumpState.EMPTY) { } else if (ps.insulinState == PumpState.EMPTY) {
reservoirView.setTextColor(Color.RED); reservoirView.setTextColor(Color.RED);
reservoirView.setText(R.string.combo_reservoir_empty); reservoirView.setText(R.string.combo_reservoir_empty);
reservoirView.setTypeface(null, Typeface.BOLD);
} else { } else {
reservoirView.setTextColor(Color.WHITE); reservoirView.setTextColor(Color.WHITE);
reservoirView.setText(R.string.combo_reservoir_normal); reservoirView.setText(R.string.combo_reservoir_normal);
reservoirView.setTypeface(null, Typeface.NORMAL);
} }
// last connection // last connection