From e9aa93f381afcf9f9cf0c39f2b9e32375ed49528 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期四, 30 十月 2025 17:39:43 +0800
Subject: [PATCH] 2025.10.30 1. 新增巡查场景历史详情相关数据逻辑(待完成);

---
 app/src/main/java/cn/flightfeather/thirdappmodule/util/DialogUtil2.kt |   35 +++++++++++++++++++++++++++++++++++
 1 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/app/src/main/java/cn/flightfeather/thirdappmodule/util/DialogUtil2.kt b/app/src/main/java/cn/flightfeather/thirdappmodule/util/DialogUtil2.kt
index f1bad8e..0a6dff3 100644
--- a/app/src/main/java/cn/flightfeather/thirdappmodule/util/DialogUtil2.kt
+++ b/app/src/main/java/cn/flightfeather/thirdappmodule/util/DialogUtil2.kt
@@ -71,6 +71,41 @@
         }
     }
 
+    fun showAlertDialog2(
+        context: Context?,
+        content: String,
+        pStr: String? = null,
+        nStr: String? = null,
+        onConfirmed: (dialog: Dialog) -> Unit = { it.dismiss() },
+        onCanceled: (dialog: Dialog) -> Unit = { it.dismiss() }
+    ): Dialog? {
+        val view = LayoutInflater.from(context).inflate(R.layout.dialog_alert_2, null)
+        return context?.let {
+            Dialog(it).apply {
+                setCancelable(false)
+                setCanceledOnTouchOutside(false)
+                setContentView(view)
+                view.findViewById<TextView>(R.id.tv_dialog_content).text = content
+                view.findViewById<TextView>(R.id.tv_positive).let {t ->
+                    pStr?.let { p -> t.text = p }
+                    t.setOnClickListener { onConfirmed(this) }
+                }
+                view.findViewById<TextView>(R.id.tv_neutral).let {t ->
+                    nStr?.let { n -> t.text = n }
+                    t.setOnClickListener { onCanceled(this) }
+                }
+                window?.attributes?.apply {
+                    gravity = Gravity.CENTER
+                    width = (ScreenUtils.getScreenWidth(context) * 0.8).toInt()
+                    windowAnimations = R.style.dialog_anim_style
+                }
+                window?.setBackgroundDrawableResource(android.R.color.transparent)
+                window?.setGravity(Gravity.CENTER)
+                show()
+            }
+        }
+    }
+
     fun showBottomDialog(
             activity: Activity?,
             anchorView: View,

--
Gitblit v1.9.3