Change order or buttons according to M3

Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
alperozturk 2023-10-16 09:19:23 +02:00
parent 35079e7106
commit 3fc0a1bf86
No known key found for this signature in database
GPG key ID: 4E577DC593B59BDF

View file

@ -157,21 +157,33 @@ public class ConfirmationDialogFragment extends DialogFragment implements Inject
});
}
if (neutralButtonTextId != -1) {
builder.setNeutralButton(neutralButtonTextId, (dialog, whichButton) -> {
if (mListener != null) {
mListener.onNeutral(getTag());
}
dialog.dismiss();
});
}
if (negativeButtonTextId != -1) {
if (negativeButtonTextId != -1 && neutralButtonTextId == -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.onCancel(getTag());
}
dialog.dismiss();
});
} else {
builder.setNegativeButton(negativeButtonTextId, (dialog, which) -> {
if (mListener != null) {
mListener.onCancel(getTag());
}
dialog.dismiss();
});
builder.setNeutralButton(neutralButtonTextId, (dialog, whichButton) -> {
if (mListener != null) {
mListener.onNeutral(getTag());
}
dialog.dismiss();
});
}
viewThemeUtils.dialog.colorMaterialAlertDialogBackground(activity, builder);