Merge branch 'dev' into dagger3

This commit is contained in:
Milos Kozak 2020-01-03 22:58:33 +01:00
commit 0ea47a333c
3 changed files with 10 additions and 17 deletions

View file

@ -108,10 +108,6 @@ public class TemporaryBasal implements Interval, DbObjectBase {
this.pumpId = extendedBolus.pumpId; this.pumpId = extendedBolus.pumpId;
} }
public String toDuration() {
return "(" + getRealDuration() + "/" + durationInMinutes + "')";
}
public TemporaryBasal clone() { public TemporaryBasal clone() {
TemporaryBasal t = new TemporaryBasal(); TemporaryBasal t = new TemporaryBasal();
t.date = date; t.date = date;

View file

@ -204,7 +204,7 @@ public class OverviewFragment extends DaggerFragment implements View.OnClickList
boolean smallWidth; boolean smallWidth;
boolean smallHeight; boolean smallHeight;
public static boolean shorttextmode = true; public static boolean shorttextmode = false;
private boolean accepted; private boolean accepted;
@ -1165,12 +1165,12 @@ public class OverviewFragment extends DaggerFragment implements View.OnClickList
String basalText = ""; String basalText = "";
if (shorttextmode) { if (shorttextmode) {
if (activeTemp != null) { if (activeTemp != null) {
basalText = activeTemp.percentRate + "% " + activeTemp.toDuration() + " " + DecimalFormatter.to2Decimal(profile.getBasal()) + "U/h"; basalText = "T: " + activeTemp.toStringVeryShort();
} else { } else {
basalText = DecimalFormatter.to2Decimal(profile.getBasal()) + "U/h"; basalText = MainApp.gs(R.string.pump_basebasalrate,profile.getBasal());
} }
baseBasalView.setOnClickListener(v -> { baseBasalView.setOnClickListener(v -> {
String fullText = resourceHelper.gs(R.string.pump_basebasalrate_label) + ": " + DecimalFormatter.to2Decimal(profile.getBasal()) + "U/h\n"; String fullText = resourceHelper.gs(R.string.pump_basebasalrate_label) + ": " + resourceHelper.gs(R.string.pump_basebasalrate,profile.getBasal()) + "\n";
if (activeTemp != null) { if (activeTemp != null) {
fullText += resourceHelper.gs(R.string.pump_tempbasal_label) + ": " + activeTemp.toStringFull(); fullText += resourceHelper.gs(R.string.pump_tempbasal_label) + ": " + activeTemp.toStringFull();
} }
@ -1179,22 +1179,18 @@ public class OverviewFragment extends DaggerFragment implements View.OnClickList
} else { } else {
if (activeTemp != null) { if (activeTemp != null) {
basalText = activeTemp.toStringFull() + " "; basalText = activeTemp.toStringFull();
} } else {
if (Config.NSCLIENT) basalText = resourceHelper.gs(R.string.pump_basebasalrate,profile.getBasal());
basalText += "(" + DecimalFormatter.to2Decimal(profile.getBasal()) + " U/h)";
else if (pump.getPumpDescription().isTempBasalCapable) {
basalText += "(" + DecimalFormatter.to2Decimal(pump.getBaseBasalRate()) + "U/h)";
} }
} }
baseBasalView.setText(basalText);
if (activeTemp != null) { if (activeTemp != null) {
baseBasalView.setTextColor(resourceHelper.gc(R.color.basal)); baseBasalView.setTextColor(resourceHelper.gc(R.color.basal));
} else { } else {
baseBasalView.setTextColor(android.R.attr.textColor); baseBasalView.setTextColor(MainApp.gc(R.color.defaulttextcolor));
} }
baseBasalView.setText(basalText);
final ExtendedBolus extendedBolus = treatmentsPlugin.getExtendedBolusFromHistory(System.currentTimeMillis()); final ExtendedBolus extendedBolus = treatmentsPlugin.getExtendedBolusFromHistory(System.currentTimeMillis());
String extendedBolusText = ""; String extendedBolusText = "";

View file

@ -33,6 +33,7 @@
<color name="defaultbackground">#424242</color> <color name="defaultbackground">#424242</color>
<color name="defaulttext">#BBBBBB</color> <color name="defaulttext">#BBBBBB</color>
<color name="defaulttextcolor">#B3FFFFFF</color>
<color name="tempTargetBackground">#77dd77</color> <color name="tempTargetBackground">#77dd77</color>
<color name="tempTargetConfirmation">#77dd77</color> <color name="tempTargetConfirmation">#77dd77</color>