check for null on getDialog()

This commit is contained in:
Milos Kozak 2016-10-17 08:57:21 +02:00
parent 2354e60f31
commit a829a506f2
6 changed files with 15 additions and 8 deletions

View file

@ -271,6 +271,7 @@ public class NewNSTreatmentDialog extends DialogFragment implements View.OnClick
@Override
public void onResume() {
super.onResume();
if (getDialog() != null)
getDialog().getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
}
@ -414,7 +415,8 @@ public class NewNSTreatmentDialog extends DialogFragment implements View.OnClick
data.put("percent", SafeParse.stringToDouble(percentEdit.getText().toString()));
if (layoutAbsolute.getVisibility() != View.GONE)
data.put("absolute", SafeParse.stringToDouble(absoluteEdit.getText().toString()));
if (options.profile && profileSpinner.getSelectedItem() != null) data.put("profile", profileSpinner.getSelectedItem().toString());
if (options.profile && profileSpinner.getSelectedItem() != null)
data.put("profile", profileSpinner.getSelectedItem().toString());
if (SafeParse.stringToDouble(carbTimeEdit.getText().toString()) != 0d)
data.put("preBolus", SafeParse.stringToDouble(carbTimeEdit.getText().toString()));
if (!notesEdit.getText().toString().equals(""))

View file

@ -65,6 +65,7 @@ public class BolusProgressDialog extends DialogFragment implements View.OnClickL
@Override
public void onResume() {
super.onResume();
if (getDialog() != null)
getDialog().getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
MainApp.bus().register(this);
running = true;

View file

@ -69,6 +69,7 @@ public class NewExtendedBolusDialog extends DialogFragment implements View.OnCli
@Override
public void onResume() {
super.onResume();
if (getDialog() != null)
getDialog().getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
}

View file

@ -94,6 +94,7 @@ public class NewTempBasalDialog extends DialogFragment implements View.OnClickLi
@Override
public void onResume() {
super.onResume();
if (getDialog() != null)
getDialog().getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
}

View file

@ -69,6 +69,7 @@ public class NewTreatmentDialog extends DialogFragment implements OnClickListene
@Override
public void onResume() {
super.onResume();
if (getDialog() != null)
getDialog().getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
}

View file

@ -330,6 +330,7 @@ public class WizardDialog extends DialogFragment implements OnClickListener {
@Override
public void onResume() {
super.onResume();
if (getDialog() != null)
getDialog().getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
}