diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewTreatmentDialog.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewTreatmentDialog.java
index e97104437d..8144d39ff5 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewTreatmentDialog.java
+++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewTreatmentDialog.java
@@ -31,7 +31,8 @@ import info.nightscout.utils.SafeParse;
public class NewTreatmentDialog extends DialogFragment implements OnClickListener {
- Button deliverButton;
+ Button okButton;
+ Button cancelButton;
TextView insulin;
TextView carbs;
@@ -52,9 +53,11 @@ public class NewTreatmentDialog extends DialogFragment implements OnClickListene
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.overview_newtreatment_dialog, null, false);
- deliverButton = (Button) view.findViewById(R.id.treatments_newtreatment_deliverbutton);
+ okButton = (Button) view.findViewById(R.id.ok);
+ okButton.setOnClickListener(this);
+ cancelButton = (Button) view.findViewById(R.id.cancel);
+ cancelButton.setOnClickListener(this);
- deliverButton.setOnClickListener(this);
getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE);
getDialog().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
insulin = (TextView) view.findViewById(R.id.treatments_newtreatment_insulinamount);
@@ -79,7 +82,7 @@ public class NewTreatmentDialog extends DialogFragment implements OnClickListene
@Override
public void onClick(View view) {
switch (view.getId()) {
- case R.id.treatments_newtreatment_deliverbutton:
+ case R.id.ok:
try {
Double insulin = SafeParse.stringToDouble(this.insulin.getText().toString());
@@ -131,6 +134,9 @@ public class NewTreatmentDialog extends DialogFragment implements OnClickListene
e.printStackTrace();
}
break;
+ case R.id.cancel:
+ dismiss();
+ break;
}
}
diff --git a/app/src/main/res/layout/careportal_newnstreatment_dialog.xml b/app/src/main/res/layout/careportal_newnstreatment_dialog.xml
index f907150f1b..59c43c3cad 100644
--- a/app/src/main/res/layout/careportal_newnstreatment_dialog.xml
+++ b/app/src/main/res/layout/careportal_newnstreatment_dialog.xml
@@ -207,16 +207,6 @@
android:layout_marginTop="5dp"
android:background="@color/listdelimiter" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ android:layout_height="wrap_content">
-
+ android:layout_alignParentStart="true"
+ android:text="@string/treatments_newtreatment_insulinamount_label"
+ android:textAppearance="@android:style/TextAppearance.Material.Small"
+ android:textStyle="bold" />
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+