From f0b53833ad2dab57ed50de5be311b029bb193dc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A6=82=E6=84=8F=20=E5=BD=AD?= <2417589739@qq.com> Date: Tue, 21 May 2024 11:47:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=A0=E9=99=A4=E5=B4=A9?= =?UTF-8?q?=E6=BA=83=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/utils/AlertDialogUtils.java | 31 ++++++++++++------- .../home/adapter/loadinggood_adapter.java | 2 +- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/com/bonait/bnframework/common/utils/AlertDialogUtils.java b/app/src/main/java/com/bonait/bnframework/common/utils/AlertDialogUtils.java index 02a9a594..3d3c6a05 100644 --- a/app/src/main/java/com/bonait/bnframework/common/utils/AlertDialogUtils.java +++ b/app/src/main/java/com/bonait/bnframework/common/utils/AlertDialogUtils.java @@ -2,6 +2,7 @@ package com.bonait.bnframework.common.utils; import android.content.Context; +import com.bonait.bnframework.HBL.Logs.MessageLog; import com.qmuiteam.qmui.widget.dialog.QMUIDialog; import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction; @@ -51,18 +52,24 @@ public class AlertDialogUtils { * 对话框,有取消确定按钮 * */ public static void showDialog(Context context, String title, String message, QMUIDialogAction.ActionListener onClickListener) { - new QMUIDialog.MessageDialogBuilder(context) - .setCancelable(false) - .setTitle(title) - .setMessage(message) - .addAction("取消", new QMUIDialogAction.ActionListener() { - @Override - public void onClick(QMUIDialog dialog, int index) { - dialog.dismiss(); - } - }) - .addAction("确定", onClickListener) - .create(mCurrentDialogStyle).show(); + try{ + new QMUIDialog.MessageDialogBuilder(context) + .setCancelable(false) + .setTitle(title) + .setMessage(message) + .addAction("取消", new QMUIDialogAction.ActionListener() { + @Override + public void onClick(QMUIDialog dialog, int index) { + dialog.dismiss(); + } + }) + .addAction("确定", onClickListener) + .create(mCurrentDialogStyle).show(); + }catch(Exception e){ + MessageLog.ShowError(e); + + } + } public static QMUIDialog showDialog111(Context context, String title, String message, QMUIDialogAction.ActionListener onClickListener) { diff --git a/app/src/main/java/com/bonait/bnframework/modules/home/adapter/loadinggood_adapter.java b/app/src/main/java/com/bonait/bnframework/modules/home/adapter/loadinggood_adapter.java index 5eacdb8b..643d1c7b 100644 --- a/app/src/main/java/com/bonait/bnframework/modules/home/adapter/loadinggood_adapter.java +++ b/app/src/main/java/com/bonait/bnframework/modules/home/adapter/loadinggood_adapter.java @@ -119,7 +119,7 @@ public class loadinggood_adapter extends RecyclerView.Adapter