ダイアログ挙動修正

This commit is contained in:
ろむねこ 2024-01-26 15:17:43 +09:00
parent 3960c07482
commit fc56781c20
No known key found for this signature in database
GPG Key ID: FA1F39A1BA37D168

View File

@ -57,17 +57,23 @@ public class LacertaCreateTagDialog extends DialogFragment {
// TextEdit // TextEdit
EditText tag_name_edit_text = view.findViewById(R.id.tag_name_edit_text); EditText tag_name_edit_text = view.findViewById(R.id.tag_name_edit_text);
com.google.android.material.textfield.TextInputLayout tag_name_text_input_layout = view.findViewById(R.id.tag_name_text_input_layout);
tag_name_text_input_layout.setHint("タグの名前");
EditText tag_color_edit_text = view.findViewById(R.id.tag_color_edit_text); EditText tag_color_edit_text = view.findViewById(R.id.tag_color_edit_text);
com.google.android.material.textfield.TextInputLayout tag_color_text_input_layout = view.findViewById(R.id.tag_color_text_input_layout);
tag_color_text_input_layout.setHint("タグの色(カラーコード)");
builder.setTitle(this.title == null ? "Create new tag" : this.title);
// Button // Button
builder.setPositiveButton(positiveButtonText, (dialog, which) -> { builder.setPositiveButton(positiveButtonText == null ? "OK" : positiveButtonText, (dialog, which) -> {
String tag_name = tag_name_edit_text.getText().toString(); String tag_name = tag_name_edit_text.getText().toString();
String tag_color = tag_color_edit_text.getText().toString(); String tag_color = tag_color_edit_text.getText().toString();
if (listener != null) { if (listener != null) {
listener.onPositiveClick(tag_name, tag_color); listener.onPositiveClick(tag_name, tag_color);
} }
}); });
builder.setNegativeButton(negativeButtonText, (dialog, which) -> { builder.setNegativeButton(negativeButtonText == null ? "Cancel" : negativeButtonText, (dialog, which) -> {
if (listener != null) { if (listener != null) {
listener.onNegativeClick(); listener.onNegativeClick();
} }