From 718f31c92e2029d05260810435a2c70cef6e6ce5 Mon Sep 17 00:00:00 2001 From: lmw <125975490@qq.com> Date: 星期四, 24 四月 2025 10:45:55 +0800 Subject: [PATCH] save --- app/src/main/java/com/sinata/xqmuse/dialog/TipDialog.kt | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 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..184d2c8 100644 --- a/app/src/main/java/com/sinata/xqmuse/dialog/TipDialog.kt +++ b/app/src/main/java/com/sinata/xqmuse/dialog/TipDialog.kt @@ -37,8 +37,11 @@ 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")?:"是否确定取消订单?" + arguments?.getString("msg")?:"" } private val ok by lazy { //确定文字 arguments?.getString("ok")?:"确认" @@ -62,6 +65,8 @@ 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 +115,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