|
@@ -2,7 +2,6 @@ package com.app.duck.dialog;
|
|
|
|
|
|
import static com.app.duck.Config.PHONE_TAG;
|
|
import static com.app.duck.Config.PHONE_TAG;
|
|
|
|
|
|
-import android.app.ProgressDialog;
|
|
|
|
import android.text.TextUtils;
|
|
import android.text.TextUtils;
|
|
|
|
|
|
import com.afollestad.materialdialogs.MaterialDialog;
|
|
import com.afollestad.materialdialogs.MaterialDialog;
|
|
@@ -10,13 +9,11 @@ import com.app.duck.R;
|
|
import com.app.duck.util.HxUtils;
|
|
import com.app.duck.util.HxUtils;
|
|
import com.blankj.utilcode.util.ActivityUtils;
|
|
import com.blankj.utilcode.util.ActivityUtils;
|
|
import com.blankj.utilcode.util.StringUtils;
|
|
import com.blankj.utilcode.util.StringUtils;
|
|
-import com.blankj.utilcode.util.ToastUtils;
|
|
|
|
import com.jeremyliao.liveeventbus.LiveEventBus;
|
|
import com.jeremyliao.liveeventbus.LiveEventBus;
|
|
|
|
|
|
public class DialogManager {
|
|
public class DialogManager {
|
|
|
|
|
|
private static DialogManager manager;
|
|
private static DialogManager manager;
|
|
- public ProgressDialog progressDialog;
|
|
|
|
|
|
|
|
public static DialogManager getInstance() {
|
|
public static DialogManager getInstance() {
|
|
if (manager == null) {
|
|
if (manager == null) {
|
|
@@ -26,22 +23,6 @@ public class DialogManager {
|
|
}
|
|
}
|
|
|
|
|
|
public static void phoneEditDialog() {
|
|
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())
|
|
new MaterialDialog.Builder(ActivityUtils.getTopActivity())
|
|
.title(R.string.phone_number)
|
|
.title(R.string.phone_number)
|
|
.canceledOnTouchOutside(false)
|
|
.canceledOnTouchOutside(false)
|
|
@@ -49,6 +30,7 @@ public class DialogManager {
|
|
.negativeText(R.string.cancel)
|
|
.negativeText(R.string.cancel)
|
|
.positiveText(R.string.done)
|
|
.positiveText(R.string.done)
|
|
.onNegative((dialog, which) -> dialog.dismiss())
|
|
.onNegative((dialog, which) -> dialog.dismiss())
|
|
|
|
+ .onPositive((dialog, which) -> dialog.dismiss())
|
|
.input("", TextUtils.isEmpty(HxUtils.getPhone()) ? "" : HxUtils.getPhone(), false, (dialog, input) ->
|
|
.input("", TextUtils.isEmpty(HxUtils.getPhone()) ? "" : HxUtils.getPhone(), false, (dialog, input) ->
|
|
{
|
|
{
|
|
if (!StringUtils.isEmpty(input)) {
|
|
if (!StringUtils.isEmpty(input)) {
|