From af31ca804feba6a3ad648107e37b4715e5e8bd83 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Sat, 15 Oct 2016 11:31:15 +0200 Subject: [PATCH] correct width on more dialogs on Andriod 6 --- .../plugins/Careportal/Dialogs/NewNSTreatmentDialog.java | 6 ++++++ .../androidaps/plugins/DanaR/Dialogs/ProfileViewDialog.java | 6 ++++++ .../plugins/Overview/Dialogs/NewExtendedBolusDialog.java | 6 ++++++ .../plugins/Overview/Dialogs/NewTempBasalDialog.java | 6 ++++++ .../plugins/Overview/Dialogs/NewTreatmentDialog.java | 6 ++++++ .../androidaps/plugins/Overview/Dialogs/WizardDialog.java | 6 ++++++ 6 files changed, 36 insertions(+) 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 a25720d0b2..db8f322c8e 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 @@ -268,6 +268,12 @@ public class NewNSTreatmentDialog extends DialogFragment implements View.OnClick return view; } + @Override + public void onResume() { + super.onResume(); + getDialog().getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); + } + @Override public void onClick(View view) { Calendar calendar = Calendar.getInstance(); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/Dialogs/ProfileViewDialog.java b/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/Dialogs/ProfileViewDialog.java index 5467d407dd..3cb21f4221 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/Dialogs/ProfileViewDialog.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/Dialogs/ProfileViewDialog.java @@ -86,6 +86,12 @@ public class ProfileViewDialog extends DialogFragment { return layout; } + @Override + public void onResume() { + super.onResume(); + getDialog().getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); + } + private void setContent() { if (profile == null) { noProfile.setVisibility(View.VISIBLE); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewExtendedBolusDialog.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewExtendedBolusDialog.java index e3be3b7225..681621a4bd 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewExtendedBolusDialog.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewExtendedBolusDialog.java @@ -66,6 +66,12 @@ public class NewExtendedBolusDialog extends DialogFragment implements View.OnCli return view; } + @Override + public void onResume() { + super.onResume(); + getDialog().getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); + } + @Override public void onClick(View view) { switch (view.getId()) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewTempBasalDialog.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewTempBasalDialog.java index 79b2d5e2f8..daac1c1c37 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewTempBasalDialog.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewTempBasalDialog.java @@ -91,6 +91,12 @@ public class NewTempBasalDialog extends DialogFragment implements View.OnClickLi return view; } + @Override + public void onResume() { + super.onResume(); + getDialog().getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); + } + @Override public void onClick(View view) { switch (view.getId()) { 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 a105d07536..a542a5a4de 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 @@ -66,6 +66,12 @@ public class NewTreatmentDialog extends DialogFragment implements OnClickListene return view; } + @Override + public void onResume() { + super.onResume(); + getDialog().getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); + } + @Override public void onClick(View view) { switch (view.getId()) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/WizardDialog.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/WizardDialog.java index af7b5610ed..33c7646013 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/WizardDialog.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/WizardDialog.java @@ -327,6 +327,12 @@ public class WizardDialog extends DialogFragment implements OnClickListener { } + @Override + public void onResume() { + super.onResume(); + getDialog().getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); + } + private void calculateInsulin() { NSProfile profile = MainApp.getConfigBuilder().getActiveProfile().getProfile(); if (profileSpinner == null || profileSpinner.getSelectedItem() == null)