lmw
2025-04-24 718f31c92e2029d05260810435a2c70cef6e6ce5
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")
        }