From 4201709e2a453914bda877c6b21cf69c88f933c5 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 16 May 2017 11:47:33 +0200 Subject: [PATCH] finish careportal dialog redesign --- .../Dialogs/NewNSTreatmentDialog.java | 40 +- .../careportal_newnstreatment_dialog.xml | 659 +++++++++++------- app/src/main/res/values-bg/strings.xml | 2 +- app/src/main/res/values-cs/strings.xml | 2 +- app/src/main/res/values-de/strings.xml | 2 +- app/src/main/res/values-es/strings.xml | 2 +- app/src/main/res/values-ko/strings.xml | 2 +- app/src/main/res/values/strings.xml | 2 +- 8 files changed, 437 insertions(+), 274 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 09b5ec4f07..9c89fdd948 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 @@ -21,6 +21,7 @@ import android.widget.CompoundButton; import android.widget.EditText; import android.widget.LinearLayout; import android.widget.RadioButton; +import android.widget.RelativeLayout; import android.widget.Spinner; import android.widget.TextView; @@ -71,16 +72,16 @@ public class NewNSTreatmentDialog extends DialogFragment implements View.OnClick NSProfile profile; String units; - LinearLayout layoutBg; + RelativeLayout layoutBg; LinearLayout layoutBgSource; - LinearLayout layoutInsulin; - LinearLayout layoutCarbs; - LinearLayout layoutSplit; - LinearLayout layoutDuration; - LinearLayout layoutPercent; - LinearLayout layoutAbsolute; - LinearLayout layoutCarbTime; - LinearLayout layoutProfile; + RelativeLayout layoutInsulin; + RelativeLayout layoutCarbs; + RelativeLayout layoutSplit; + RelativeLayout layoutDuration; + RelativeLayout layoutPercent; + RelativeLayout layoutAbsolute; + RelativeLayout layoutCarbTime; + RelativeLayout layoutProfile; LinearLayout layoutTempTarget; Button dateButton; Button timeButton; @@ -143,18 +144,19 @@ public class NewNSTreatmentDialog extends DialogFragment implements View.OnClick public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { getDialog().setTitle(getString(options.eventName)); + setStyle(DialogFragment.STYLE_NORMAL, getTheme()); View view = inflater.inflate(R.layout.careportal_newnstreatment_dialog, container, false); - layoutBg = (LinearLayout) view.findViewById(R.id.careportal_newnstreatment_bg_layout); + layoutBg = (RelativeLayout) view.findViewById(R.id.careportal_newnstreatment_bg_layout); layoutBgSource = (LinearLayout) view.findViewById(R.id.careportal_newnstreatment_bgsource_layout); - layoutInsulin = (LinearLayout) view.findViewById(R.id.careportal_newnstreatment_insulin_layout); - layoutCarbs = (LinearLayout) view.findViewById(R.id.careportal_newnstreatment_carbs_layout); - layoutSplit = (LinearLayout) view.findViewById(R.id.careportal_newnstreatment_split_layout); - layoutDuration = (LinearLayout) view.findViewById(R.id.careportal_newnstreatment_duration_layout); - layoutPercent = (LinearLayout) view.findViewById(R.id.careportal_newnstreatment_percent_layout); - layoutAbsolute = (LinearLayout) view.findViewById(R.id.careportal_newnstreatment_absolute_layout); - layoutCarbTime = (LinearLayout) view.findViewById(R.id.careportal_newnstreatment_carbtime_layout); - layoutProfile = (LinearLayout) view.findViewById(R.id.careportal_newnstreatment_profile_layout); + layoutInsulin = (RelativeLayout) view.findViewById(R.id.careportal_newnstreatment_insulin_layout); + layoutCarbs = (RelativeLayout) view.findViewById(R.id.careportal_newnstreatment_carbs_layout); + layoutSplit = (RelativeLayout) view.findViewById(R.id.careportal_newnstreatment_split_layout); + layoutDuration = (RelativeLayout) view.findViewById(R.id.careportal_newnstreatment_duration_layout); + layoutPercent = (RelativeLayout) view.findViewById(R.id.careportal_newnstreatment_percent_layout); + layoutAbsolute = (RelativeLayout) view.findViewById(R.id.careportal_newnstreatment_absolute_layout); + layoutCarbTime = (RelativeLayout) view.findViewById(R.id.careportal_newnstreatment_carbtime_layout); + layoutProfile = (RelativeLayout) view.findViewById(R.id.careportal_newnstreatment_profile_layout); layoutTempTarget = (LinearLayout) view.findViewById(R.id.careportal_newnstreatment_temptarget_layout); bgUnitsView = (TextView) view.findViewById(R.id.careportal_newnstreatment_bgunits); @@ -372,7 +374,7 @@ public class NewNSTreatmentDialog extends DialogFragment implements View.OnClick } } - private void showOrHide(LinearLayout layout, boolean visible) { + private void showOrHide(ViewGroup layout, boolean visible) { if (visible) layout.setVisibility(View.VISIBLE); else layout.setVisibility(View.GONE); } diff --git a/app/src/main/res/layout/careportal_newnstreatment_dialog.xml b/app/src/main/res/layout/careportal_newnstreatment_dialog.xml index d6c50a6d71..f907150f1b 100644 --- a/app/src/main/res/layout/careportal_newnstreatment_dialog.xml +++ b/app/src/main/res/layout/careportal_newnstreatment_dialog.xml @@ -18,26 +18,25 @@ android:orientation="vertical"> + android:orientation="horizontal"> @@ -87,15 +86,15 @@ + android:orientation="vertical"> + + + + android:orientation="horizontal"> + + + + + + + android:orientation="horizontal"> + + - + android:layout_alignParentStart="true" + android:layout_marginRight="10dp" + android:text="@string/careportal_newnstreatment_duration_label" + android:textAppearance="@android:style/TextAppearance.Material.Small" + android:textStyle="bold" /> - + + + + + + - + android:layout_width="match_parent" + android:layout_height="wrap_content"> + android:textAppearance="@android:style/TextAppearance.Material.Small" + android:textStyle="bold" /> - + android:layout_centerInParent="true" + android:orientation="horizontal"> + + - + - + + + - - + + + + + android:layout_width="match_parent" + android:layout_height="wrap_content"> + android:textAppearance="@android:style/TextAppearance.Material.Small" + android:textStyle="bold" /> - + android:layout_centerInParent="true" + android:orientation="horizontal"> + + - + - + + + - - + + + + + android:layout_width="match_parent" + android:layout_height="wrap_content"> + android:textAppearance="@android:style/TextAppearance.Material.Small" + android:textStyle="bold" /> - + android:layout_centerInParent="true" + android:orientation="horizontal"> + + - + - + + + - + - + + + android:layout_width="match_parent" + android:layout_height="wrap_content"> + android:textAppearance="@android:style/TextAppearance.Material.Small" + android:textStyle="bold" /> + + android:layout_height="wrap_content" + android:layout_centerInParent="true" /> + - + + android:orientation="vertical"> - + + android:textAppearance="@android:style/TextAppearance.Material.Small" + android:textStyle="bold" /> + android:layout_height="wrap_content" + android:layout_centerHorizontal="true" /> - + - + + android:textAppearance="@android:style/TextAppearance.Material.Small" + android:textStyle="bold" /> - + android:layout_centerHorizontal="true" + android:orientation="horizontal"> - + + - + + + + + - + android:layout_width="match_parent" + android:layout_height="wrap_content"> + android:textAppearance="@android:style/TextAppearance.Material.Small" + android:textStyle="bold" /> - - + + + + + android:layout_width="match_parent" + android:layout_height="wrap_content"> - -