Merge branch 'dev' into history

This commit is contained in:
Milos Kozak 2017-05-12 23:14:07 +02:00
commit b1d9e647c6

View file

@ -26,6 +26,7 @@ import info.nightscout.androidaps.R;
import info.nightscout.androidaps.data.GlucoseStatus;
import info.nightscout.androidaps.plugins.NSClientInternal.data.NSProfile;
import info.nightscout.utils.PlusMinusEditText;
import info.nightscout.utils.SafeParse;
import info.nightscout.utils.XdripCalibrations;
public class CalibrationDialog extends DialogFragment implements View.OnClickListener {
@ -34,6 +35,7 @@ public class CalibrationDialog extends DialogFragment implements View.OnClickLis
Button okButton;
PlusMinusEditText bgText;
TextView unitsView;
TextView bgView;
Context context;
@ -72,6 +74,7 @@ public class CalibrationDialog extends DialogFragment implements View.OnClickLis
unitsView = (TextView) view.findViewById(R.id.overview_calibration_units);
unitsView.setText(units);
bgView = (TextView) view.findViewById(R.id.overview_calibration_bg);
return view;
}
@ -80,7 +83,7 @@ public class CalibrationDialog extends DialogFragment implements View.OnClickLis
public void onClick(View view) {
switch (view.getId()) {
case R.id.overview_calibration_okbutton:
final Double bg = bgText.getValue();
final Double bg = SafeParse.stringToDouble(this.bgView.getText().toString());;
XdripCalibrations.confirmAndSendCalibration(bg, context);
dismiss();
Answers.getInstance().logCustom(new CustomEvent("Calibration"));