package com.swago.room.dialog

import android.os.Bundle
import android.view.Gravity
import com.alibaba.android.arouter.launcher.ARouter
import com.swago.baseswago.constant.ARouteConstant
import com.swago.baseswago.dialog.BaseXDFragment
import com.swago.baseswago.util.NoDoubleClickListener
import com.swago.room.databinding.DialogReachLevelServiceBinding

class ReachLevelServiceDialog :  BaseXDFragment<DialogReachLevelServiceBinding>(){

    init {
        setGravity(Gravity.CENTER)
        setDimAmount(0.5f)
        setCanCancel(true)
    }

    companion object{
        fun newInstance(content:String): ReachLevelServiceDialog {
            val args = Bundle()
            args.putString("msg",content)
            val fragment = ReachLevelServiceDialog()
            fragment.arguments = args
            return fragment
        }
    }

    override fun initOther() {
        arguments?.let {
            val msg = it.getString("msg","")
            binding.tvContent.text = msg
        }

        binding.tvContactService.setOnClickListener(object: NoDoubleClickListener(){
            override fun onClick() {
                ARouter.getInstance().build(ARouteConstant.User.customService).navigation()
                dismissAllowingStateLoss()
            }
        })
    }

    override fun initLiveData() {
    }
}