|
@@ -63,7 +63,7 @@ public class ConfirmationDialogFragment extends DialogFragment implements Inject
|
|
|
* @return Dialog ready to show.
|
|
|
*/
|
|
|
public static ConfirmationDialogFragment newInstance(int messageResId, String[] messageArguments, int titleResId,
|
|
|
- int positiveButtonTextId, int neutralButtonTextId, int negativeButtonTextId) {
|
|
|
+ int positiveButtonTextId, int negativeButtonTextId, int neutralButtonTextId) {
|
|
|
if (messageResId == -1) {
|
|
|
throw new IllegalStateException("Calling confirmation dialog without message resource");
|
|
|
}
|
|
@@ -156,29 +156,16 @@ public class ConfirmationDialogFragment extends DialogFragment implements Inject
|
|
|
dialog.dismiss();
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
- if (negativeButtonTextId != -1 && neutralButtonTextId == -1) {
|
|
|
+ if (negativeButtonTextId != -1) {
|
|
|
builder.setNegativeButton(negativeButtonTextId, (dialog, which) -> {
|
|
|
if (mListener != null) {
|
|
|
mListener.onCancel(getTag());
|
|
|
}
|
|
|
dialog.dismiss();
|
|
|
});
|
|
|
- } else if (neutralButtonTextId != -1 && negativeButtonTextId == -1) {
|
|
|
- builder.setNegativeButton(neutralButtonTextId, (dialog, which) -> {
|
|
|
- if (mListener != null) {
|
|
|
- mListener.onNeutral(getTag());
|
|
|
- }
|
|
|
- dialog.dismiss();
|
|
|
- });
|
|
|
- } else {
|
|
|
- builder.setNegativeButton(negativeButtonTextId, (dialog, which) -> {
|
|
|
- if (mListener != null) {
|
|
|
- mListener.onCancel(getTag());
|
|
|
- }
|
|
|
- dialog.dismiss();
|
|
|
- });
|
|
|
- builder.setNeutralButton(neutralButtonTextId, (dialog, whichButton) -> {
|
|
|
+ }
|
|
|
+ if (neutralButtonTextId != -1) {
|
|
|
+ builder.setNeutralButton(neutralButtonTextId, (dialog, which) -> {
|
|
|
if (mListener != null) {
|
|
|
mListener.onNeutral(getTag());
|
|
|
}
|