From 704ad383e9ec87a8c50052205951f582751f3107 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Mon, 15 May 2017 21:10:43 +0200 Subject: [PATCH 1/5] careportal layout part1 --- .../Dialogs/NewNSTreatmentDialog.java | 10 +- .../careportal_newnstreatment_dialog.xml | 486 +++++++++--------- 2 files changed, 260 insertions(+), 236 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Careportal/Dialogs/NewNSTreatmentDialog.java b/app/src/main/java/info/nightscout/androidaps/plugins/Careportal/Dialogs/NewNSTreatmentDialog.java index dc313f994d..09b5ec4f07 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Careportal/Dialogs/NewNSTreatmentDialog.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Careportal/Dialogs/NewNSTreatmentDialog.java @@ -85,6 +85,7 @@ public class NewNSTreatmentDialog extends DialogFragment implements View.OnClick Button dateButton; Button timeButton; Button okButton; + Button cancelButton; TextView bgUnitsView; RadioButton meterRadioButton; @@ -218,8 +219,10 @@ public class NewNSTreatmentDialog extends DialogFragment implements View.OnClick dateButton.setOnClickListener(this); timeButton.setOnClickListener(this); - okButton = (Button) view.findViewById(R.id.careportal_newnstreatment_ok); + okButton = (Button) view.findViewById(R.id.ok); okButton.setOnClickListener(this); + cancelButton = (Button) view.findViewById(R.id.cancel); + cancelButton.setOnClickListener(this); // profile profile = MainApp.getConfigBuilder().getActiveProfile().getProfile(); @@ -359,10 +362,13 @@ public class NewNSTreatmentDialog extends DialogFragment implements View.OnClick tpd.dismissOnPause(true); tpd.show(context.getFragmentManager(), "Timepickerdialog"); break; - case R.id.careportal_newnstreatment_ok: + case R.id.ok: createNSTreatment(); dismiss(); 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 70a4a09eb3..d6c50a6d71 100644 --- a/app/src/main/res/layout/careportal_newnstreatment_dialog.xml +++ b/app/src/main/res/layout/careportal_newnstreatment_dialog.xml @@ -1,5 +1,6 @@ - + + android:textAppearance="@android:style/TextAppearance.Material.Medium" + android:textStyle="bold" /> - + android:layout_centerInParent="true" + android:orientation="horizontal" + android:visibility="visible"> - + - + + + + + - + + android:visibility="visible"> + android:checked="true" + android:text="@string/careportal_newnstreatment_sensor" /> - + + android:textAppearance="@android:style/TextAppearance.Material.Medium" + android:textStyle="bold" /> - - - - + android:orientation="horizontal" + android:visibility="visible"> - + + + + + + + + - + - + + android:textAppearance="@android:style/TextAppearance.Material.Medium" + android:textStyle="bold" /> - - - - + android:orientation="horizontal"> - + + + + + + + + - + - + + android:textAppearance="@android:style/TextAppearance.Material.Medium" + android:textStyle="bold" /> - + android:layout_centerInParent="true" + android:orientation="horizontal" + android:visibility="visible"> + + - + - + + + - - + - + - - - - + android:orientation="horizontal"> - + + + + + + + + + - - + + android:inputType="numberDecimal" /> - + android:inputType="numberDecimal" /> @@ -681,29 +718,10 @@ - - -