Get correct calibration value if entered with (onboard) keyboard
This commit is contained in:
parent
a60afbceb9
commit
bb35f58eab
|
@ -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"));
|
||||
|
|
Loading…
Reference in a new issue