From 3f4cf57bbc09c888abf3890970499885079d2b26 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Fri, 12 May 2017 23:04:14 +0200 Subject: [PATCH 1/7] make all Spiners centered --- .../plugins/Careportal/Dialogs/NewNSTreatmentDialog.java | 6 ++---- .../plugins/Overview/Dialogs/EditQuickWizardDialog.java | 3 +-- .../plugins/PumpDanaR/History/DanaRHistoryActivity.java | 3 +-- .../PumpDanaRKorean/History/DanaRHistoryActivity.java | 3 +-- app/src/main/java/info/nightscout/utils/TimeListEdit.java | 3 +-- 5 files changed, 6 insertions(+), 12 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 f0cf085e16..dc313f994d 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 @@ -233,8 +233,7 @@ public class NewNSTreatmentDialog extends DialogFragment implements View.OnClick profileList = profile.getProfileList(); } ArrayAdapter adapter = new ArrayAdapter(getContext(), - android.R.layout.simple_spinner_item, profileList); - adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); + R.layout.spinner_centered, profileList); profileSpinner.setAdapter(adapter); if (profile != null) { // set selected to actual profile @@ -250,8 +249,7 @@ public class NewNSTreatmentDialog extends DialogFragment implements View.OnClick reasonList.add(MainApp.sResources.getString(R.string.activity)); reasonList.add(MainApp.sResources.getString(R.string.manual)); ArrayAdapter adapterReason = new ArrayAdapter(getContext(), - android.R.layout.simple_spinner_item, reasonList); - adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); + R.layout.spinner_centered, reasonList); reasonSpinner.setAdapter(adapterReason); // bg diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/EditQuickWizardDialog.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/EditQuickWizardDialog.java index a86740cdfd..352c158c1e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/EditQuickWizardDialog.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/EditQuickWizardDialog.java @@ -71,8 +71,7 @@ public class EditQuickWizardDialog extends DialogFragment implements View.OnClic timeList.add(DateUtil.timeString(DateUtil.toDate(24 * 60 * 60 - 60))); ArrayAdapter adapter = new ArrayAdapter(getContext(), - android.R.layout.simple_spinner_item, timeList); - adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); + R.layout.spinner_centered, timeList); fromSpinner.setAdapter(adapter); toSpinner.setAdapter(adapter); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/History/DanaRHistoryActivity.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/History/DanaRHistoryActivity.java index bc925c27bd..f4ad770ac1 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/History/DanaRHistoryActivity.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/History/DanaRHistoryActivity.java @@ -169,8 +169,7 @@ public class DanaRHistoryActivity extends Activity { typeList.add(new TypeList(RecordTypes.RECORD_TYPE_REFILL, getString(R.string.danar_history_refill))); typeList.add(new TypeList(RecordTypes.RECORD_TYPE_SUSPEND, getString(R.string.danar_history_syspend))); ArrayAdapter spinnerAdapter = new ArrayAdapter<>(this, - android.R.layout.simple_spinner_item, typeList); - spinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); + R.layout.spinner_centered, typeList); historyTypeSpinner.setAdapter(spinnerAdapter); reloadButton.setOnClickListener(new View.OnClickListener() { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRKorean/History/DanaRHistoryActivity.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRKorean/History/DanaRHistoryActivity.java index adbbf09e75..8b2811e382 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRKorean/History/DanaRHistoryActivity.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRKorean/History/DanaRHistoryActivity.java @@ -168,8 +168,7 @@ public class DanaRHistoryActivity extends Activity { typeList.add(new TypeList(RecordTypes.RECORD_TYPE_GLUCOSE, getString(R.string.danar_history_glucose))); ArrayAdapter spinnerAdapter = new ArrayAdapter<>(this, - android.R.layout.simple_spinner_item, typeList); - spinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); + R.layout.spinner_centered, typeList); historyTypeSpinner.setAdapter(spinnerAdapter); reloadButton.setOnClickListener(new View.OnClickListener() { diff --git a/app/src/main/java/info/nightscout/utils/TimeListEdit.java b/app/src/main/java/info/nightscout/utils/TimeListEdit.java index 1c4f5d4edd..ce1f604060 100644 --- a/app/src/main/java/info/nightscout/utils/TimeListEdit.java +++ b/app/src/main/java/info/nightscout/utils/TimeListEdit.java @@ -229,8 +229,7 @@ public class TimeListEdit { } ArrayAdapter adapter = new ArrayAdapter(context, - android.R.layout.simple_spinner_item, timeList); - adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); + R.layout.spinner_centered, timeList); spinner.setAdapter(adapter); spinner.setSelection(posInList, false); } From 2aaa7f42d69be94b83438bdda2dc8db3a870bcb1 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Sun, 14 May 2017 10:13:56 +0200 Subject: [PATCH 2/7] gradle update --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index b78a0b86c9..d0aa70430c 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.3.1' + classpath 'com.android.tools.build:gradle:2.3.2' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files From 85744548d8f39803c2807ba75279e05c317b6dfe Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Sun, 14 May 2017 11:48:59 +0200 Subject: [PATCH 3/7] typo in log --- .../plugins/IobCobCalculator/IobCobCalculatorPlugin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobCalculatorPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobCalculatorPlugin.java index b28927d3ba..85a5c886bd 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobCalculatorPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobCalculatorPlugin.java @@ -412,7 +412,7 @@ public class IobCobCalculatorPlugin implements PluginBase { //log.debug("Locking detectSensitivity"); synchronized (dataLock) { if (autosensDataTable == null || autosensDataTable.size() < 4) { - log.debug("No bucketed data available"); + log.debug("No autosens data available"); return new AutosensResult(); } From 704ad383e9ec87a8c50052205951f582751f3107 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Mon, 15 May 2017 21:10:43 +0200 Subject: [PATCH 4/7] 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 @@ - - -