Skip to content
Snippets Groups Projects
Commit 6813c9e5 authored by Lennart Goedhart's avatar Lennart Goedhart Committed by GitHub
Browse files

Merge pull request #121 from Pogman/develop

Visual fixes
parents 0d1c0893 d57cf860
Branches
Tags
No related merge requests found
...@@ -645,8 +645,8 @@ public class MainActivity extends AppCompatActivity implements OnSharedPreferenc ...@@ -645,8 +645,8 @@ public class MainActivity extends AppCompatActivity implements OnSharedPreferenc
public static String strFormatSGV(double sgvValue) { public static String strFormatSGV(double sgvValue) {
ConfigurationStore configurationStore = ConfigurationStore.getInstance(); ConfigurationStore configurationStore = ConfigurationStore.getInstance();
NumberFormat sgvFormatter;
if (configurationStore.isMmolxl()) { if (configurationStore.isMmolxl()) {
NumberFormat sgvFormatter;
if (configurationStore.isMmolxlDecimals()) { if (configurationStore.isMmolxlDecimals()) {
sgvFormatter = new DecimalFormat("0.00"); sgvFormatter = new DecimalFormat("0.00");
} else { } else {
...@@ -654,7 +654,8 @@ public class MainActivity extends AppCompatActivity implements OnSharedPreferenc ...@@ -654,7 +654,8 @@ public class MainActivity extends AppCompatActivity implements OnSharedPreferenc
} }
return sgvFormatter.format(sgvValue / MMOLXLFACTOR); return sgvFormatter.format(sgvValue / MMOLXLFACTOR);
} else { } else {
return String.valueOf(sgvValue); sgvFormatter = new DecimalFormat("0");
return sgvFormatter.format(sgvValue);
} }
} }
...@@ -824,13 +825,9 @@ public class MainActivity extends AppCompatActivity implements OnSharedPreferenc ...@@ -824,13 +825,9 @@ public class MainActivity extends AppCompatActivity implements OnSharedPreferenc
mChart.getViewport().setMinX(left); mChart.getViewport().setMinX(left);
mChart.getViewport().setYAxisBoundsManual(true); mChart.getViewport().setYAxisBoundsManual(true);
if (configurationStore.isMmolxl()) { mChart.getViewport().setMinY(80);
mChart.getViewport().setMinY(80 / MMOLXLFACTOR); mChart.getViewport().setMaxY(120);
mChart.getViewport().setMaxY(120 / MMOLXLFACTOR);
} else {
mChart.getViewport().setMinY(80);
mChart.getViewport().setMaxY(120);
}
mChart.postInvalidate(); mChart.postInvalidate();
return; return;
} }
...@@ -874,12 +871,11 @@ public class MainActivity extends AppCompatActivity implements OnSharedPreferenc ...@@ -874,12 +871,11 @@ public class MainActivity extends AppCompatActivity implements OnSharedPreferenc
@Override @Override
public void draw(Canvas canvas, Paint paint, float x, float y, DataPointInterface dataPoint) { public void draw(Canvas canvas, Paint paint, float x, float y, DataPointInterface dataPoint) {
double sgv = dataPoint.getY(); double sgv = dataPoint.getY();
boolean mmolxl = configurationStore.isMmolxl(); if (sgv < 80)
if (sgv < 80)
paint.setColor(Color.RED); paint.setColor(Color.RED);
else if (sgv <= 180) else if (sgv <= 180)
paint.setColor(Color.GREEN); paint.setColor(Color.GREEN);
else if (sgv <= 260) else if (sgv <= 260)
paint.setColor(Color.YELLOW); paint.setColor(Color.YELLOW);
else else
paint.setColor(Color.RED); paint.setColor(Color.RED);
......
...@@ -244,8 +244,8 @@ public class MedtronicCnlIntentService extends IntentService { ...@@ -244,8 +244,8 @@ public class MedtronicCnlIntentService extends IntentService {
// Check if pump sent old event when new expected // Check if pump sent old event when new expected
if (dataStore.getLastPumpStatus() != null && if (dataStore.getLastPumpStatus() != null &&
dataStore.getLastPumpStatus().getPumpDate() != null && dataStore.getLastPumpStatus().getSgvDate() != null &&
pumpRecord.getPumpDate().getTime() - dataStore.getLastPumpStatus().getPumpDate().getTime() < 5000L && pumpRecord.getSgvDate().getTime() - dataStore.getLastPumpStatus().getSgvDate().getTime() < 5000L &&
timePollExpected - timePollStarted < 5000L) { timePollExpected - timePollStarted < 5000L) {
sendStatus("Pump sent old SGV event"); sendStatus("Pump sent old SGV event");
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment