From bee2d6cacc7ff3af682897eee1eac4720f5e1b8d Mon Sep 17 00:00:00 2001
From: lmw <125975490@qq.com>
Date: 星期六, 08 二月 2025 18:15:37 +0800
Subject: [PATCH] 新增功能开发完成

---
 app/src/main/java/com/sinata/xqmuse/dialog/TipDialog.kt |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/app/src/main/java/com/sinata/xqmuse/dialog/TipDialog.kt b/app/src/main/java/com/sinata/xqmuse/dialog/TipDialog.kt
index 8c865b0..92a577a 100644
--- a/app/src/main/java/com/sinata/xqmuse/dialog/TipDialog.kt
+++ b/app/src/main/java/com/sinata/xqmuse/dialog/TipDialog.kt
@@ -37,6 +37,9 @@
     private val isAlert by lazy {  //是否仅显示提示信息
         arguments?.getBoolean("isAlert",false)?:false
     }
+    private val title by lazy {  //标题
+        arguments?.getString("title")?:"提示"
+    }
     private val msg by lazy {  //提示信息
         arguments?.getString("msg")?:"是否确定取消订单?"
     }
@@ -62,6 +65,7 @@
             tv_msg.text = SpanBuilder(msg).color(requireContext(),6,msg.length-2,R.color.colorPrimary).build()
         else
             tv_msg.text = msg
+        tv_title.text = title
         tv_ok.text = ok
         tv_cancel.text = cancel
 
@@ -110,9 +114,9 @@
     }
 
     companion object{
-        fun show(fm:FragmentManager,msg:String,callback: OnClickCallback,ok:String = "确认",cancel:String="关闭",isAlert:Boolean = false){
+        fun show(fm:FragmentManager,msg:String,callback: OnClickCallback,ok:String = "确认",cancel:String="关闭",isAlert:Boolean = false,title:String = "提示"){
             val tipDialog = TipDialog()
-            tipDialog.arguments = bundleOf("msg" to msg,"ok" to ok,"cancel" to cancel,"isAlert" to isAlert)
+            tipDialog.arguments = bundleOf("msg" to msg,"ok" to ok,"cancel" to cancel,"isAlert" to isAlert,"title" to title)
             tipDialog.setCallback(callback)
             tipDialog.showAllowingStateLoss(fm,"tip")
         }

--
Gitblit v1.7.1