show target range as number if equal

This commit is contained in:
Milos Kozak 2017-06-20 20:10:14 +02:00
parent befdbefa49
commit e9898a58c7

View file

@ -961,7 +961,12 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
} }
tempTargetView.setTextColor(Color.WHITE); tempTargetView.setTextColor(Color.WHITE);
tempTargetView.setBackgroundColor(MainApp.sResources.getColor(R.color.tempTargetDisabledBackground)); tempTargetView.setBackgroundColor(MainApp.sResources.getColor(R.color.tempTargetDisabledBackground));
tempTargetView.setText(SP.getDouble("openapsma_min_bg", minBgDefault) + " - " + SP.getDouble("openapsma_max_bg", maxBgDefault)); double low = SP.getDouble("openapsma_min_bg", minBgDefault);
double high = SP.getDouble("openapsma_max_bg", maxBgDefault);
if (low == high)
tempTargetView.setText("" + low);
else
tempTargetView.setText(low + " - " + high);
tempTargetView.setVisibility(View.VISIBLE); tempTargetView.setVisibility(View.VISIBLE);
} }
if (Config.NSCLIENT && tempTarget == null) { if (Config.NSCLIENT && tempTarget == null) {