選択肢のテキストが指定されていない場合の既定値を定義

This commit is contained in:
r-ca 2024-01-29 00:45:10 +09:00
parent d66546a567
commit 8542869a63
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9

View File

@ -119,11 +119,11 @@ public class LacertaApplyTagDialog extends DialogFragment {
builder.setTitle(title) builder.setTitle(title)
.setMessage(message) .setMessage(message)
.setView(view) .setView(view)
.setPositiveButton(positiveButtonText, (dialog, id) -> { .setPositiveButton(positiveButtonText == null ? "OK" : positiveButtonText, (dialog, id) -> {
// Send the positive button event back to the host activity // Send the positive button event back to the host activity
listener.onDialogPositiveClick(LacertaApplyTagDialog.this); listener.onDialogPositiveClick(LacertaApplyTagDialog.this);
}) })
.setNegativeButton(negativeButtonText, (dialog, id) -> { .setNegativeButton(negativeButtonText == null ? "Cancel" : negativeButtonText, (dialog, id) -> {
// Send the negative button event back to the host activity // Send the negative button event back to the host activity
listener.onDialogNegativeClick(LacertaApplyTagDialog.this); listener.onDialogNegativeClick(LacertaApplyTagDialog.this);
}); });