Skip to content
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.

Commit

Permalink
Use framework dialog where applicable (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
SUPERCILEX authored and samtstern committed Aug 22, 2017
1 parent 556b2ce commit 32ab68f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Bundle toBundle() {
return bundle;
}

AlertDialog createDialog(Context context, Dialog.OnClickListener listener) {
AlertDialog createSupportDialog(Context context, Dialog.OnClickListener listener) {
return new AlertDialog.Builder(context)
.setCancelable(false)
.setPositiveButton(positiveButton, listener)
Expand All @@ -63,4 +63,13 @@ AlertDialog createDialog(Context context, Dialog.OnClickListener listener) {
.create();
}

android.app.AlertDialog createFrameworkDialog(Context context, Dialog.OnClickListener listener) {
return new android.app.AlertDialog.Builder(context)
.setCancelable(false)
.setPositiveButton(positiveButton, listener)
.setNegativeButton(negativeButton, listener)
.setMessage(rationaleMsg)
.create();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public Dialog onCreateDialog(Bundle savedInstanceState) {
new RationaleDialogClickListener(this, config, mPermissionCallbacks);

// Create an AlertDialog
return config.createDialog(getActivity(), clickListener);
return config.createFrameworkDialog(getActivity(), clickListener);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@ public Dialog onCreateDialog(Bundle savedInstanceState) {
new RationaleDialogClickListener(this, config, mPermissionCallbacks);

// Create an AlertDialog
return config.createDialog(getContext(), clickListener);
return config.createSupportDialog(getContext(), clickListener);
}
}

1 comment on commit 32ab68f

@Griffin641498
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

34ab68f

Please sign in to comment.