mirror of
https://github.com/nextcloud/android.git
synced 2024-11-28 02:17:43 +03:00
Change order or buttons according to M3
Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
parent
35079e7106
commit
3fc0a1bf86
1 changed files with 21 additions and 9 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue