|
@@ -2,7 +2,6 @@ package com.app.duck.dialog;
|
|
|
|
|
|
import static com.app.duck.Config.PHONE_TAG;
|
|
|
|
|
|
-import android.app.ProgressDialog;
|
|
|
import android.text.TextUtils;
|
|
|
|
|
|
import com.afollestad.materialdialogs.MaterialDialog;
|
|
@@ -10,13 +9,11 @@ import com.app.duck.R;
|
|
|
import com.app.duck.util.HxUtils;
|
|
|
import com.blankj.utilcode.util.ActivityUtils;
|
|
|
import com.blankj.utilcode.util.StringUtils;
|
|
|
-import com.blankj.utilcode.util.ToastUtils;
|
|
|
import com.jeremyliao.liveeventbus.LiveEventBus;
|
|
|
|
|
|
public class DialogManager {
|
|
|
|
|
|
private static DialogManager manager;
|
|
|
- public ProgressDialog progressDialog;
|
|
|
|
|
|
public static DialogManager getInstance() {
|
|
|
if (manager == null) {
|
|
@@ -26,22 +23,6 @@ public class DialogManager {
|
|
|
}
|
|
|
|
|
|
public static void phoneEditDialog() {
|
|
|
-// Activity context = ActivityUtils.getTopActivity();
|
|
|
-// androidx.appcompat.app.AlertDialog.Builder builder = new androidx.appcompat.app.AlertDialog.Builder(context);
|
|
|
-// builder.setTitle(R.string.phone_number);
|
|
|
-// builder.setMessage(R.string.number);
|
|
|
-// final EditText editText = new EditText(context);
|
|
|
-// builder.setView(editText);
|
|
|
-// builder.setPositiveButton(R.string.ok, (dialog, which) -> {
|
|
|
-// String name = editText.getText().toString();
|
|
|
-// if (!StringUtils.isEmpty(name)) {
|
|
|
-// HxUtils.setPhone(name);
|
|
|
-// LiveEventBus.get(PHONE_TAG).post(name);
|
|
|
-// }
|
|
|
-// });
|
|
|
-// builder.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.cancel());
|
|
|
-// AlertDialog dialog = builder.create();
|
|
|
-// dialog.show();
|
|
|
new MaterialDialog.Builder(ActivityUtils.getTopActivity())
|
|
|
.title(R.string.phone_number)
|
|
|
.canceledOnTouchOutside(false)
|
|
@@ -49,6 +30,7 @@ public class DialogManager {
|
|
|
.negativeText(R.string.cancel)
|
|
|
.positiveText(R.string.done)
|
|
|
.onNegative((dialog, which) -> dialog.dismiss())
|
|
|
+ .onPositive((dialog, which) -> dialog.dismiss())
|
|
|
.input("", TextUtils.isEmpty(HxUtils.getPhone()) ? "" : HxUtils.getPhone(), false, (dialog, input) ->
|
|
|
{
|
|
|
if (!StringUtils.isEmpty(input)) {
|