Revert "InputDialogのWrapper作成 WIP"

This reverts commit 301fab8024.
This commit is contained in:
ろむねこ 2024-01-22 12:07:52 +09:00
parent 301fab8024
commit 580e79b03a
No known key found for this signature in database
GPG Key ID: FA1F39A1BA37D168

View File

@ -1,28 +0,0 @@
package one.nem.lacerta.utils;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import java.util.concurrent.CompletableFuture;
public class TextInputDialog {
public static CompletableFuture<String> show(Context context, String title, String message, String defaultValue, String positiveButton, String negativeButton) {
return CompletableFuture.supplyAsync(() -> {
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle(title);
builder.setMessage(message);
final android.widget.EditText input = new android.widget.EditText(context);
input.setText(defaultValue);
builder.setView(input);
builder.setPositiveButton(positiveButton, (dialog, which) -> {
dialog.dismiss();
});
builder.setNegativeButton(negativeButton, (dialog, which) -> {
dialog.cancel();
});
builder.show();
return input.getText().toString();
});
}
}