another fix of displaying ext bolus

This commit is contained in:
Milos Kozak 2018-07-11 18:02:20 +03:00
parent 798199852b
commit e4e0e64eef

View file

@ -1200,15 +1200,12 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
} else { } else {
basalText = DecimalFormatter.to2Decimal(profile.getBasal()) + "U/h"; basalText = DecimalFormatter.to2Decimal(profile.getBasal()) + "U/h";
} }
baseBasalView.setOnClickListener(new View.OnClickListener() { baseBasalView.setOnClickListener(v -> {
@Override String fullText = MainApp.gs(R.string.pump_basebasalrate_label) + ": " + DecimalFormatter.to2Decimal(profile.getBasal()) + "U/h\n";
public void onClick(View v) { if (activeTemp != null) {
String fullText = MainApp.gs(R.string.pump_basebasalrate_label) + ": " + DecimalFormatter.to2Decimal(profile.getBasal()) + "U/h\n"; fullText += MainApp.gs(R.string.pump_tempbasal_label) + ": " + activeTemp.toStringFull();
if (activeTemp != null) {
fullText += MainApp.gs(R.string.pump_tempbasal_label) + ": " + activeTemp.toStringFull();
}
OKDialog.show(getActivity(), MainApp.gs(R.string.basal), fullText, null);
} }
OKDialog.show(getActivity(), MainApp.gs(R.string.basal), fullText, null);
}); });
} else { } else {
@ -1237,22 +1234,17 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
if (extendedBolus != null && !pump.isFakingTempsByExtendedBoluses()) { if (extendedBolus != null && !pump.isFakingTempsByExtendedBoluses()) {
extendedBolusText = DecimalFormatter.to2Decimal(extendedBolus.absoluteRate()) + "U/h"; extendedBolusText = DecimalFormatter.to2Decimal(extendedBolus.absoluteRate()) + "U/h";
} }
extendedBolusView.setText(extendedBolusText);
extendedBolusView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
OKDialog.show(getActivity(), MainApp.gs(R.string.extendedbolus), extendedBolus.toString(), null);
}
});
} else { } else {
if (extendedBolus != null && !pump.isFakingTempsByExtendedBoluses()) { if (extendedBolus != null && !pump.isFakingTempsByExtendedBoluses()) {
extendedBolusText = extendedBolus.toString(); extendedBolusText = extendedBolus.toString();
} }
extendedBolusView.setText(extendedBolusText); }
extendedBolusView.setText(extendedBolusText);
if (Config.NSCLIENT || Config.G5UPLOADER) {
extendedBolusView.setOnClickListener(v -> OKDialog.show(getActivity(), MainApp.gs(R.string.extendedbolus), extendedBolus.toString(), null));
} }
if (extendedBolusText.equals("")) if (extendedBolusText.equals(""))
extendedBolusView.setVisibility(shorttextmode ? View.INVISIBLE : View.GONE); extendedBolusView.setVisibility(Config.NSCLIENT || Config.G5UPLOADER ? View.INVISIBLE : View.GONE);
else else
extendedBolusView.setVisibility(View.VISIBLE); extendedBolusView.setVisibility(View.VISIBLE);
} }