package com.gamedog.vididin.features.withdraw.dialogs


import android.app.Activity
import com.ama.core.architecture.util.ResUtil
import com.ama.core.architecture.util.setOnClickBatch
import com.ama.core.architecture.widget.BindingDialog
import com.viddin.videos.free.R
import com.viddin.videos.free.databinding.DialogWithdrawSuccessBinding as ViewBinding


class WithdrawSuccessDialog(context: Activity, private val mCashNum: Double = 0.0, private val cashNumStr: String = "") : BindingDialog<ViewBinding>(context, ViewBinding::inflate) {

    init {
        build()
    }


    private fun build() {
        with()
        setCenter()
        setMaskValue(0.8f)
        setCanCancel(false)

        mBinding.run {
            setOnClickBatch(flAction, ivClose) {
                when (this) {
                    ivClose ->  {
                        dismiss()
                    }
                    flAction ->  {
                        dismiss()
                    }
                }
            }

            if (mCashNum > 0F) {
                tvCashNum.text = ResUtil.getString(R.string.cash) + " " + mCashNum.toString()
            } else {
                tvCashNum.text = cashNumStr
            }

        }
    }
}

